diff options
author | Jim Miller <jaggies@google.com> | 2013-10-16 18:15:46 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2013-10-16 19:42:34 -0700 |
commit | e5f910a667088ab63e017d5851f0956c77b823da (patch) | |
tree | 6f48fd0c0277b0384936a1aca978e395d1b6b727 /policy/src | |
parent | 9c446d82736dde10a9cf13de9165334f4e699afe (diff) | |
download | frameworks_base-e5f910a667088ab63e017d5851f0956c77b823da.zip frameworks_base-e5f910a667088ab63e017d5851f0956c77b823da.tar.gz frameworks_base-e5f910a667088ab63e017d5851f0956c77b823da.tar.bz2 |
Fix issue where keyguard adds widgets before the system is ready
While under heavy system load, keyguard was able to create widgets before
before ActivityManagerService was ready. The result was a race
between keyguard adding widgets and ActivityManagerService being
ready to send broadcasts.
This fix provides keyguard with an additional signal to know when
the system is booted and widgets are safe to load.
Fixes bug b/11217169
Change-Id: I7a714d65b068678f961e52bdde4e1c20f9c287f0
Diffstat (limited to 'policy/src')
3 files changed, 22 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 1c43014..816672f 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -4668,6 +4668,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ public void systemBooted() { + if (mKeyguardDelegate != null) { + mKeyguardDelegate.onBootCompleted(); + } synchronized (mLock) { mSystemBooted = true; } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java index 56a282b..bf22e2f 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java @@ -52,6 +52,7 @@ public class KeyguardServiceDelegate { public int offReason; public int currentUser; public boolean screenIsOn; + public boolean bootCompleted; }; public interface ShowListener { @@ -117,6 +118,9 @@ public class KeyguardServiceDelegate { // This is used to hide the scrim once keyguard displays. mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null)); } + if (mKeyguardState.bootCompleted) { + mKeyguardService.onBootCompleted(); + } } @Override @@ -305,4 +309,11 @@ public class KeyguardServiceDelegate { }); } + public void onBootCompleted() { + if (mKeyguardService != null) { + mKeyguardService.onBootCompleted(); + } + mKeyguardState.bootCompleted = true; + } + } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java index 83be1a8..9fb2a50 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java @@ -180,6 +180,14 @@ public class KeyguardServiceWrapper implements IKeyguardService { } } + public void onBootCompleted() { + try { + mService.onBootCompleted(); + } catch (RemoteException e) { + Slog.w(TAG , "Remote Exception", e); + } + } + public void showAssistant() { // Not used by PhoneWindowManager } |