summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-11-20 14:45:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-20 14:45:11 +0000
commit8f6f256ac11f156fdcfc7cc6c913132cf8adadde (patch)
treec5399323b0aaf9bd387d494e98550334cf785fec
parent295543d9f203b9285c470e8f76b16a408e218152 (diff)
parentc8f4e1bc88401cad3cc5e439cd08450974d99d81 (diff)
downloadandroid_packages_apps_Trebuchet-8f6f256ac11f156fdcfc7cc6c913132cf8adadde.tar.gz
android_packages_apps_Trebuchet-8f6f256ac11f156fdcfc7cc6c913132cf8adadde.tar.bz2
android_packages_apps_Trebuchet-8f6f256ac11f156fdcfc7cc6c913132cf8adadde.zip
am c8f4e1bc: Fix a couple regressions from resetting AppsCustomizeTabHost
* commit 'c8f4e1bc88401cad3cc5e439cd08450974d99d81': Fix a couple regressions from resetting AppsCustomizeTabHost
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java8
-rw-r--r--src/com/android/launcher3/AppsCustomizeTabHost.java4
-rw-r--r--src/com/android/launcher3/Launcher.java5
-rw-r--r--src/com/android/launcher3/PagedViewWithDraggableItems.java2
4 files changed, 13 insertions, 6 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 8aa013f8b..c8187f068 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -839,6 +839,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
cancelAllTasks();
}
+ @Override
+ public void trimMemory() {
+ super.trimMemory();
+ clearAllWidgetPages();
+ }
+
public void clearAllWidgetPages() {
cancelAllTasks();
int count = getChildCount();
@@ -1472,9 +1478,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
- @Override
public void reset() {
- super.reset();
// If we have reset, then we should not continue to restore the previous state
mSaveInstanceStateItemIndex = -1;
diff --git a/src/com/android/launcher3/AppsCustomizeTabHost.java b/src/com/android/launcher3/AppsCustomizeTabHost.java
index 69e3ac17f..a2717126d 100644
--- a/src/com/android/launcher3/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher3/AppsCustomizeTabHost.java
@@ -118,6 +118,10 @@ public class AppsCustomizeTabHost extends FrameLayout implements LauncherTransit
mPagedView.reset();
}
+ void trimMemory() {
+ mPagedView.trimMemory();
+ }
+
public void onWindowVisible() {
if (getVisibility() == VISIBLE) {
mContent.setVisibility(VISIBLE);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 0d1d3ef6e..ac46fd33d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3815,10 +3815,9 @@ public class Launcher extends Activity
// 3MB of memory for caching which isn't necessary.
SQLiteDatabase.releaseMemory();
- // We reset the apps customize tray in order to
- // to free all the memory associated with widget previews
+ // This clears all widget bitmaps from the widget tray
if (mAppsCustomizeTabHost != null) {
- mAppsCustomizeTabHost.reset();
+ mAppsCustomizeTabHost.trimMemory();
}
}
}
diff --git a/src/com/android/launcher3/PagedViewWithDraggableItems.java b/src/com/android/launcher3/PagedViewWithDraggableItems.java
index 7f4a3a032..0e593698d 100644
--- a/src/com/android/launcher3/PagedViewWithDraggableItems.java
+++ b/src/com/android/launcher3/PagedViewWithDraggableItems.java
@@ -91,7 +91,7 @@ public abstract class PagedViewWithDraggableItems extends PagedView
return super.onTouchEvent(ev);
}
- public void reset() {
+ public void trimMemory() {
mLastTouchedItem = null;
}