Merge "Remove overly tight constraint on drawn Keyguard." into klp-dev

This commit is contained in:
Craig Mautner
2013-10-09 19:10:44 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 10 deletions

View File

@ -420,6 +420,7 @@ public class KeyguardViewManager {
public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback) { public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback) {
if (DEBUG) Log.d(TAG, "onScreenTurnedOn()"); if (DEBUG) Log.d(TAG, "onScreenTurnedOn()");
mScreenOn = true; mScreenOn = true;
final IBinder token = mKeyguardHost == null ? null : mKeyguardHost.getWindowToken();
if (mKeyguardView != null) { if (mKeyguardView != null) {
mKeyguardView.onScreenTurnedOn(); mKeyguardView.onScreenTurnedOn();
@ -432,10 +433,6 @@ public class KeyguardViewManager {
mKeyguardHost.post(new Runnable() { mKeyguardHost.post(new Runnable() {
@Override @Override
public void run() { public void run() {
IBinder token = null;
if (mKeyguardHost.getVisibility() == View.VISIBLE) {
token = mKeyguardHost.getWindowToken();
}
try { try {
callback.onShown(token); callback.onShown(token);
} catch (RemoteException e) { } catch (RemoteException e) {
@ -445,7 +442,7 @@ public class KeyguardViewManager {
}); });
} else { } else {
try { try {
callback.onShown(null); callback.onShown(token);
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.w(TAG, "Exception calling onShown():", e); Slog.w(TAG, "Exception calling onShown():", e);
} }
@ -453,7 +450,7 @@ public class KeyguardViewManager {
} }
} else if (callback != null) { } else if (callback != null) {
try { try {
callback.onShown(null); callback.onShown(token);
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.w(TAG, "Exception calling onShown():", e); Slog.w(TAG, "Exception calling onShown():", e);
} }

View File

@ -4282,12 +4282,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
})) { })) {
return; return;
} }
Slog.i(TAG, "No lock screen! waitForWindowDrawn false");
} catch (RemoteException ex) { } catch (RemoteException ex) {
// Can't happen in system process. // Can't happen in system process.
} }
} }
Slog.i(TAG, "No lock screen!"); Slog.i(TAG, "No lock screen! windowToken=" + windowToken);
finishScreenTurningOn(screenOnListener); finishScreenTurningOn(screenOnListener);
} }

View File

@ -9473,9 +9473,8 @@ public class WindowManagerService extends IWindowManager.Stub
//Slog.i(TAG, "Waiting for drawn " + win + ": removed=" //Slog.i(TAG, "Waiting for drawn " + win + ": removed="
// + win.mRemoved + " visible=" + win.isVisibleLw() // + win.mRemoved + " visible=" + win.isVisibleLw()
// + " shown=" + win.mSurfaceShown); // + " shown=" + win.mSurfaceShown);
if (win.mRemoved || !win.isVisibleLw()) { if (win.mRemoved) {
// Window has been removed or made invisible; no draw // Window has been removed; no draw will now happen, so stop waiting.
// will now happen, so stop waiting.
Slog.w(TAG, "Aborted waiting for drawn: " + pair.first); Slog.w(TAG, "Aborted waiting for drawn: " + pair.first);
try { try {
pair.second.sendResult(null); pair.second.sendResult(null);
@ -9510,6 +9509,7 @@ public class WindowManagerService extends IWindowManager.Stub
checkDrawnWindowsLocked(); checkDrawnWindowsLocked();
return true; return true;
} }
Slog.i(TAG, "waitForWindowDrawn: win null");
} }
} }
return false; return false;