diff options
author | vadimt <vadimt@google.com> | 2019-06-03 18:35:52 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-06-03 18:35:52 -0700 |
commit | 3ca5280186aad28a47916ecbf52cead127bb40b7 (patch) | |
tree | 802ba6d54386deaca72435226bae861df846a024 /src | |
parent | 164ebb2e8c15ba6b21bac943490fe8c5127d230b (diff) | |
download | android_packages_apps_Trebuchet-3ca5280186aad28a47916ecbf52cead127bb40b7.tar.gz android_packages_apps_Trebuchet-3ca5280186aad28a47916ecbf52cead127bb40b7.tar.bz2 android_packages_apps_Trebuchet-3ca5280186aad28a47916ecbf52cead127bb40b7.zip |
Fixing All Apps's getting stuck in a non-updating state
Normally, if all apps is open, and an app installs/uninstalls/updates,
All Apps will immediately reflect this.
However, depending on something subtle in the intensity of the swipe
gesture that brought All Apps, all apps will freeze, and won't update.
This frozen state will go away after scrolling in all apps, iteration
with an icon and, generally, any tap interaction with All Apps.
Otherwise, it will stay until it's closed and opened again via a gesture
with a different pattern.
The reason is in the code that freezes All Apps updates during user
interactions with all apps.
For example, during scrolls. Or while the user holds an icon, expecting
to see a context menu; in this case an update would cause the menu to
not appear, which is somewhat annoying.
The motivation to add this code was to solve a category of lab-only
flakes when a context menu couldn't open because the lab device was busy
with post-flash activities.
The code incorrectly assumed that after ACTION_DOWN, we are guaranteed
to get either UP or CANCEL, which is wrong.
It's after *consumed* ACTION_DOWN that we'll get these events.
The fix still solves the user's and tests' problems that the code was
supposed to solve.
Bug: 134442147
Change-Id: I9db74a33ecf93b1dc6bc69df301f7f542dea2a40
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 053c57004..0d43e214e 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -625,15 +625,16 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo @Override public boolean dispatchTouchEvent(MotionEvent ev) { + final boolean result = super.dispatchTouchEvent(ev); switch (ev.getActionMasked()) { case MotionEvent.ACTION_DOWN: - mAllAppsStore.setDeferUpdates(true); + if (result) mAllAppsStore.setDeferUpdates(true); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mAllAppsStore.setDeferUpdates(false); break; } - return super.dispatchTouchEvent(ev); + return result; } } |