diff options
author | vadimt <vadimt@google.com> | 2019-06-13 18:42:25 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-06-13 18:42:25 -0700 |
commit | 5ad52ec092cb934760d3a9b693546b4377a92025 (patch) | |
tree | af52b4fea8f4cffd47ff70a546a0de8433a256ef /tests | |
parent | c1fa3abd2e441d4acfdf6ca8d3ba628776f2ba6d (diff) | |
download | android_packages_apps_Trebuchet-5ad52ec092cb934760d3a9b693546b4377a92025.tar.gz android_packages_apps_Trebuchet-5ad52ec092cb934760d3a9b693546b4377a92025.tar.bz2 android_packages_apps_Trebuchet-5ad52ec092cb934760d3a9b693546b4377a92025.zip |
After switching nav mode, wait for the sysui mode to sync
Bug: 133867119
Change-Id: I0290753aa295bc3167e1d396cedd410c77413579
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index e45fca8c0..09df3960a 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -208,14 +208,10 @@ public final class LauncherInstrumentation { // app context are not constructed with resources that take overlays into account final Context ctx = baseContext.createPackageContext("android", 0); for (int i = 0; i < 100; ++i) { - log("Interaction mode = " + getCurrentInteractionMode(ctx)); - if (isGesturalMode(ctx)) { - return NavigationModel.ZERO_BUTTON; - } else if (isSwipeUpMode(ctx)) { - return NavigationModel.TWO_BUTTON; - } else if (isLegacyMode(ctx)) { - return NavigationModel.THREE_BUTTON; - } + final int currentInteractionMode = getCurrentInteractionMode(ctx); + log("Interaction mode = " + currentInteractionMode); + final NavigationModel model = getNavigationModel(currentInteractionMode); + if (model != null) return model; Thread.sleep(100); } fail("Can't detect navigation mode"); @@ -225,6 +221,17 @@ public final class LauncherInstrumentation { return NavigationModel.THREE_BUTTON; } + public static NavigationModel getNavigationModel(int currentInteractionMode) { + if (QuickStepContract.isGesturalMode(currentInteractionMode)) { + return NavigationModel.ZERO_BUTTON; + } else if (QuickStepContract.isSwipeUpMode(currentInteractionMode)) { + return NavigationModel.TWO_BUTTON; + } else if (QuickStepContract.isLegacyMode(currentInteractionMode)) { + return NavigationModel.THREE_BUTTON; + } + return null; + } + public static boolean isAvd() { return Build.MODEL.contains("Cuttlefish"); } @@ -742,19 +749,7 @@ public final class LauncherInstrumentation { return currentTime; } - public static boolean isGesturalMode(Context context) { - return QuickStepContract.isGesturalMode(getCurrentInteractionMode(context)); - } - - public static boolean isSwipeUpMode(Context context) { - return QuickStepContract.isSwipeUpMode(getCurrentInteractionMode(context)); - } - - public static boolean isLegacyMode(Context context) { - return QuickStepContract.isLegacyMode(getCurrentInteractionMode(context)); - } - - private static int getCurrentInteractionMode(Context context) { + public static int getCurrentInteractionMode(Context context) { return getSystemIntegerRes(context, "config_navBarInteractionMode"); } |