summaryrefslogtreecommitdiffstats
path: root/policy/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-11-21 14:02:34 -0800
committerMichael Jurka <mikejurka@google.com>2012-11-21 14:02:34 -0800
commit545043e59e906525af646b1ecad1797258797590 (patch)
tree5573955d5afbb3a687b236053dfcaeb54c664a64 /policy/src
parent007c64ffbf13d16bb97e582140b3bb21f94c367a (diff)
downloadframeworks_base-545043e59e906525af646b1ecad1797258797590.zip
frameworks_base-545043e59e906525af646b1ecad1797258797590.tar.gz
frameworks_base-545043e59e906525af646b1ecad1797258797590.tar.bz2
Fix reboot loop caused by keyguard appwidget cleanup
Bug: 7591092
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;
+ }
}
};