diff options
author | Adam Cohen <adamcohen@google.com> | 2012-11-07 11:45:30 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2012-11-07 11:45:30 -0800 |
commit | 4eb36cfdcabb51f67a887d867de9559966606d86 (patch) | |
tree | 4b0eed045c150e20877eb0a0a84b8632598fdadc /policy | |
parent | e41dd0f195d77329bdf686af1dcbfd92bdbb5373 (diff) | |
download | frameworks_base-4eb36cfdcabb51f67a887d867de9559966606d86.zip frameworks_base-4eb36cfdcabb51f67a887d867de9559966606d86.tar.gz frameworks_base-4eb36cfdcabb51f67a887d867de9559966606d86.tar.bz2 |
Storing boot completed in KeyguardUpdateMonitor so it is persistent (issue 7492235)
Change-Id: I736816dac8cea47632fbdbc75b367f2c6216dff7
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 4 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 1ee0e86..d9c11a4 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -75,7 +75,6 @@ public class KeyguardHostView extends KeyguardViewBase { private SecurityMode mCurrentSecuritySelection = SecurityMode.Invalid; private int mAppWidgetToShow; - private boolean mBootCompleted = false; private boolean mCheckAppWidgetConsistencyOnBootCompleted = false; protected Runnable mLaunchRunnable; @@ -147,7 +146,6 @@ public class KeyguardHostView extends KeyguardViewBase { new KeyguardUpdateMonitorCallback() { @Override public void onBootCompleted() { - mBootCompleted = true; if (mCheckAppWidgetConsistencyOnBootCompleted) { checkAppWidgetConsistency(); mSwitchPageRunnable.run(); @@ -1107,7 +1105,7 @@ public class KeyguardHostView extends KeyguardViewBase { public void checkAppWidgetConsistency() { // Since this method may bind a widget (which we can't do until boot completed) we // may have to defer it until after boot complete. - if (!mBootCompleted) { + if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) { mCheckAppWidgetConsistencyOnBootCompleted = true; return; } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java index 51f0418..e1007f9 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardUpdateMonitor.java @@ -95,6 +95,7 @@ public class KeyguardUpdateMonitor { private int mRingMode; private int mPhoneState; private boolean mKeyguardIsVisible; + private boolean mBootCompleted; // Device provisioning state private boolean mDeviceProvisioned; @@ -431,6 +432,7 @@ public class KeyguardUpdateMonitor { * Handle {@link #MSG_BOOT_COMPLETED} */ protected void handleBootCompleted() { + mBootCompleted = true; for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { @@ -440,6 +442,14 @@ public class KeyguardUpdateMonitor { } /** + * We need to store this state in the KeyguardUpdateMonitor since this class will not be + * destroyed. + */ + public boolean hasBootCompleted() { + return mBootCompleted; + } + + /** * Handle {@link #MSG_USER_SWITCHED} */ protected void handleUserRemoved(int userId) { |