Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8f4e1bc authored by Adam Cohen's avatar Adam Cohen
Browse files

Fix a couple regressions from resetting AppsCustomizeTabHost

Bug 18409435
Bug 18358080

Change-Id: I07a071342b5c5e062ab2bb562b672d93ba0d5c2e
parent 08072c05
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;

+4 −0
Original line number Diff line number Diff line
@@ -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);
+2 −3
Original line number Diff line number Diff line
@@ -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();
            }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public abstract class PagedViewWithDraggableItems extends PagedView
        return super.onTouchEvent(ev);
    }

    public void reset() {
    public void trimMemory() {
        mLastTouchedItem = null;
    }