summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-08-27 15:34:29 -0700
committerWinson Chung <winsonc@google.com>2012-08-27 17:42:09 -0700
commit81b52252796625dcbadc9f8b908f8d8a284565c0 (patch)
tree0457cea72f58f429463db1eaa2a7aee07bea8256 /src/com/android/launcher2/Launcher.java
parent2b3396f9c0e88d1633e16483322d2c52cfc271f3 (diff)
downloadandroid_packages_apps_Trebuchet-81b52252796625dcbadc9f8b908f8d8a284565c0.tar.gz
android_packages_apps_Trebuchet-81b52252796625dcbadc9f8b908f8d8a284565c0.tar.bz2
android_packages_apps_Trebuchet-81b52252796625dcbadc9f8b908f8d8a284565c0.zip
Ensuring that unbind calls are not queued in the worker thread and executed subsequently on the main thread. (Bug 7001531)
Change-Id: I677242c0952d6385ca229ba300fdd5a2a7908a8a
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 1e138f772..2fcf86925 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1486,8 +1486,11 @@ public final class Launcher extends Activity
TextKeyListener.getInstance().release();
-
- unbindWorkspaceAndHotseatItems();
+ // Disconnect any of the callbacks and drawables associated with ItemInfos on the workspace
+ // to prevent leaking Launcher activities on orientation change.
+ if (mModel != null) {
+ mModel.unbindItemInfosAndClearQueuedBindRunnables();
+ }
getContentResolver().unregisterContentObserver(mWidgetObserver);
unregisterReceiver(mCloseSystemDialogsReceiver);
@@ -1878,16 +1881,6 @@ public final class Launcher extends Activity
}
/**
- * Go through the and disconnect any of the callbacks in the drawables and the views or we
- * leak the previous Home screen on orientation change.
- */
- private void unbindWorkspaceAndHotseatItems() {
- if (mModel != null) {
- mModel.unbindWorkspaceItems();
- }
- }
-
- /**
* Launches the intent referred by the clicked shortcut.
*
* @param v The view representing the clicked shortcut.