From 2b3303c744cc136991f055b799e591edbcbccafe Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 13 Aug 2019 18:27:43 -0700 Subject: [PATCH] Not freezing All Apps during user interactions Extremely rarely, All Apps will get stuck in a non-updating state even after the interaction ends. It would be impractical to try drilling to the root cause of this, so it's better to just allow All Apps updates while the user interacts with it. Bug: 139384936 Change-Id: I2ed7fb052da77a9e47ef9b9aa7800499071b98c3 --- .../launcher3/allapps/AllAppsContainerView.java | 16 ---------------- .../android/launcher3/allapps/AllAppsStore.java | 4 +--- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 4a2109e588..293b86722d 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -628,20 +628,4 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo return super.performAccessibilityAction(action, arguments); } - - @Override - public boolean dispatchTouchEvent(MotionEvent ev) { - final boolean result = super.dispatchTouchEvent(ev); - switch (ev.getActionMasked()) { - case MotionEvent.ACTION_DOWN: - if (result) mAllAppsStore.enableDeferUpdates( - AllAppsStore.DEFER_UPDATES_USER_INTERACTION); - break; - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_CANCEL: - mAllAppsStore.disableDeferUpdates(AllAppsStore.DEFER_UPDATES_USER_INTERACTION); - break; - } - return result; - } } diff --git a/src/com/android/launcher3/allapps/AllAppsStore.java b/src/com/android/launcher3/allapps/AllAppsStore.java index 267363fa7d..ca8dbebfc2 100644 --- a/src/com/android/launcher3/allapps/AllAppsStore.java +++ b/src/com/android/launcher3/allapps/AllAppsStore.java @@ -39,10 +39,8 @@ public class AllAppsStore { // Defer updates flag used to defer all apps updates to the next draw. public static final int DEFER_UPDATES_NEXT_DRAW = 1 << 0; - // Defer updates flag used to defer all apps updates while the user interacts with all apps. - public static final int DEFER_UPDATES_USER_INTERACTION = 1 << 1; // Defer updates flag used to defer all apps updates by a test's request. - public static final int DEFER_UPDATES_TEST = 1 << 2; + public static final int DEFER_UPDATES_TEST = 1 << 1; private PackageUserKey mTempKey = new PackageUserKey(null, null); private final HashMap mComponentToAppMap = new HashMap<>();