mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Disabling updating All Apps during a long-press recognition
This is supposed to eliminate test flakes in the lab. When an app gets updated while all apps is opened, all-apps will be re-laid-out. If the layout happens while we are recognizing a long-press on an app icon in all Apps, the long-press won't be recognized. In the lab, this happened so frequently that it caused considerable flakiness. Even after we started running tests in airplane mode, this still keeps happening. The bug refers an example with airplane mode on. The fix will be also mildly beneficial for users. Bug: 132177321 Change-Id: Ie7c7473fe94b8af83f04cd719286bae69e2d9de0
This commit is contained in:
@@ -604,4 +604,18 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
|
||||
return super.performAccessibilityAction(action, arguments);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
switch (ev.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mAllAppsStore.setDeferUpdates(true);
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
mAllAppsStore.setDeferUpdates(false);
|
||||
break;
|
||||
}
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user