Freezing all apps updates during certain tests

This CL adds a very low risk because most (but not all) changes affect
only Launcher behavior during the test.

This should fix a lab-only flake when all apps keeps changing while
the test is working with it.

Example: test figures out which icon to click, by the moment it clicks
there, there is another icon there, or the icon is under the search box,
and clicking opens IME.

Switching test devices to airplane mode didn't help. The earlier change
that prevents popup menu cancellation is not general enough.

Now the tests are given an API to explicitly freeze and unfreeze
all-apps, which should be a final solution.

Bug: 132900132
Bug: 133765434
Change-Id: I8b81cc9be004482beb6cdcdd05406e2d9b4c7629
This commit is contained in:
vadimt
2019-06-04 13:59:43 -07:00
parent 8474ab2b9d
commit d4c90e12e9
8 changed files with 194 additions and 81 deletions

View File

@@ -628,11 +628,12 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
final boolean result = super.dispatchTouchEvent(ev);
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
if (result) mAllAppsStore.setDeferUpdates(true);
if (result) mAllAppsStore.enableDeferUpdates(
AllAppsStore.DEFER_UPDATES_USER_INTERACTION);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mAllAppsStore.setDeferUpdates(false);
mAllAppsStore.disableDeferUpdates(AllAppsStore.DEFER_UPDATES_USER_INTERACTION);
break;
}
return result;