summaryrefslogtreecommitdiffstats
path: root/policy/src/com/android
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-03-31 16:35:15 +0200
committerJorim Jaggi <jjaggi@google.com>2014-04-02 22:11:19 +0200
commitcff0acb6b1eea23c3f44a078a0a5e81c11faea35 (patch)
tree900f324f271f8cfceccdc64575333b9aca15cbf1 /policy/src/com/android
parent8533b95b4c217c588bddfbc1e57051377d963cc0 (diff)
downloadframeworks_base-cff0acb6b1eea23c3f44a078a0a5e81c11faea35.zip
frameworks_base-cff0acb6b1eea23c3f44a078a0a5e81c11faea35.tar.gz
frameworks_base-cff0acb6b1eea23c3f44a078a0a5e81c11faea35.tar.bz2
Wait for Keyguard to be drawn after boot.
The old logic with waiting for the Keyguard to be drawn assumed that it is in an own window, and just checked for the visibility. This is no longer possible as the Keyguard is in the status bar, and the status bar might have been drawn without the Keyguard. So we have to wait explicitely until Keyguard told PhoneWindowManager that it has now been drawn and we can turn on the screen. In addition, the starting logic of SystemUI is moved into SystemUIApplication such the we can make sure that the status bar already exists when the callbacks from PhoneWindowManager reach KeyguardService. This simplifies the logic a lot. Bug: 13635952 Change-Id: Ifd6ba795647edcf3501641e39052e4d04bc826fb
Diffstat (limited to 'policy/src/com/android')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java40
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 928fd9b..8205fef 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;