Merge "Extend accessibility timeout indefinitely before overview screenshot" into tm-qpr-dev am: 0eb98be739 am: 5064184974

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19251370

Change-Id: If7f0c11c3fc0f3f182fb56c9498dabf316c0ad24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Winson Chung
2022-07-13 01:00:04 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 0 deletions
@@ -373,6 +373,17 @@ public final class LauncherInstrumentation {
sActiveContainer = new WeakReference<>(container);
}
/**
* Sets the accesibility interactive timeout to be effectively indefinite (UI using this
* accesibility timeout will not automatically dismiss if true).
*/
void setIndefiniteAccessibilityInteractiveUiTimeout(boolean indefiniteTimeout) {
final String cmd = indefiniteTimeout
? "settings put secure accessibility_interactive_ui_timeout_ms 10000"
: "settings delete secure accessibility_interactive_ui_timeout_ms";
logShellCommand(cmd);
}
public NavigationModel getNavigationModel() {
final Context baseContext = mInstrumentation.getTargetContext();
try {
@@ -41,6 +41,8 @@ public class OverviewActions {
try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to click screenshot button and exit screenshot ui")) {
mLauncher.setIndefiniteAccessibilityInteractiveUiTimeout(true);
UiObject2 screenshot = mLauncher.waitForObjectInContainer(mOverviewActions,
"action_screenshot");
@@ -62,6 +64,8 @@ public class OverviewActions {
return new Overview(mLauncher);
}
}
} finally {
mLauncher.setIndefiniteAccessibilityInteractiveUiTimeout(false);
}
}