diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-04-02 21:22:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-02 21:22:59 +0000 |
commit | ae6ffcc3c74d12ebf59a26cce24d04fdd2b56f4e (patch) | |
tree | b7e205cea9805bf2c79b4073a267cf3d75c63e66 /policy/src/com/android | |
parent | ab6e1116340277bcb10637c44335cab37871d8ce (diff) | |
parent | cff0acb6b1eea23c3f44a078a0a5e81c11faea35 (diff) | |
download | frameworks_base-ae6ffcc3c74d12ebf59a26cce24d04fdd2b56f4e.zip frameworks_base-ae6ffcc3c74d12ebf59a26cce24d04fdd2b56f4e.tar.gz frameworks_base-ae6ffcc3c74d12ebf59a26cce24d04fdd2b56f4e.tar.bz2 |
Merge "Wait for Keyguard to be drawn after boot." into master-lockscreen-dev
Diffstat (limited to 'policy/src/com/android')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 026d44e..62878e9 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -177,6 +177,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { */ private WindowState mKeyguardScrim; private boolean mKeyguardHidden; + private boolean mKeyguardDrawn; /* Table of Application Launch keys. Maps from key codes to intent categories. * @@ -4355,21 +4356,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { private void waitForKeyguard(final ScreenOnListener screenOnListener) { if (mKeyguardDelegate != null) { - if (screenOnListener != null) { - mKeyguardDelegate.onScreenTurnedOn(new KeyguardServiceDelegate.ShowListener() { - @Override - public void onShown(IBinder windowToken) { - waitForKeyguardWindowDrawn(windowToken, screenOnListener); - } - }); - return; - } else { - mKeyguardDelegate.onScreenTurnedOn(null); - } + mKeyguardDelegate.onScreenTurnedOn(new KeyguardServiceDelegate.ShowListener() { + @Override + public void onShown(IBinder windowToken) { + waitForKeyguardWindowDrawn(windowToken, screenOnListener); + } + }); } else { Slog.i(TAG, "No keyguard interface!"); + finishScreenTurningOn(screenOnListener); } - finishScreenTurningOn(screenOnListener); } private void waitForKeyguardWindowDrawn(IBinder windowToken, @@ -4382,6 +4378,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { public void sendResult(Bundle data) { Slog.i(TAG, "Lock screen displayed!"); finishScreenTurningOn(screenOnListener); + setKeyguardDrawn(); } })) { return; @@ -4395,6 +4392,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { Slog.i(TAG, "No lock screen! windowToken=" + windowToken); finishScreenTurningOn(screenOnListener); + setKeyguardDrawn(); } private void finishScreenTurningOn(ScreenOnListener screenOnListener) { @@ -4475,6 +4473,23 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + private void setKeyguardDrawn() { + synchronized (mLock) { + mKeyguardDrawn = true; + } + try { + mWindowManager.enableScreenIfNeeded(); + } catch (RemoteException unhandled) { + } + } + + @Override + public boolean isKeyguardDrawnLw() { + synchronized (mLock) { + return mKeyguardDrawn; + } + } + void sendCloseSystemWindows() { sendCloseSystemWindows(mContext, null); } @@ -4758,6 +4773,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { synchronized (mLock) { mSystemBooted = true; } + waitForKeyguard(null); } ProgressDialog mBootMsgDialog = null; |