summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
index c54d9a711436..bdc25d974408 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
@@ -1587,7 +1587,13 @@ public class KeyguardHostView extends KeyguardViewBase {
@Override
public void cleanUp() {
-
+ // Make sure we let go of all widgets and their package contexts promptly. If we don't do
+ // this, and the associated application is uninstalled, it can cause a soft reboot.
+ int count = mAppWidgetContainer.getChildCount();
+ for (int i = 0; i < count; i++) {
+ KeyguardWidgetFrame frame = mAppWidgetContainer.getWidgetPageAt(i);
+ frame.removeAllViews();
+ }
}
/**