summaryrefslogtreecommitdiffstats
path: root/policy/src
diff options
context:
space:
mode:
Diffstat (limited to 'policy/src')
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java11
1 files changed, 11 insertions, 0 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 0e25c84..84f3d61 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
@@ -81,6 +81,7 @@ public class KeyguardHostView extends KeyguardViewBase {
private int mAppWidgetToShow;
private boolean mCheckAppWidgetConsistencyOnBootCompleted = false;
+ private boolean mCleanupAppWidgetsOnBootCompleted = false;
protected OnDismissAction mDismissAction;
@@ -155,6 +156,12 @@ public class KeyguardHostView extends KeyguardViewBase {
}
private void cleanupAppWidgetIds() {
+ // Since this method may delete a widget (which we can't do until boot completed) we
+ // may have to defer it until after boot complete.
+ if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
+ mCleanupAppWidgetsOnBootCompleted = true;
+ return;
+ }
// Clean up appWidgetIds that are bound to lockscreen, but not actually used
// This is only to clean up after another bug: we used to not call
// deleteAppWidgetId when a user manually deleted a widget in keyguard. This code
@@ -190,6 +197,10 @@ public class KeyguardHostView extends KeyguardViewBase {
mSwitchPageRunnable.run();
mCheckAppWidgetConsistencyOnBootCompleted = false;
}
+ if (mCleanupAppWidgetsOnBootCompleted) {
+ cleanupAppWidgetIds();
+ mCleanupAppWidgetsOnBootCompleted = false;
+ }
}
};