diff options
author | Vadim Tryshev <vadimt@google.com> | 2019-06-14 01:53:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-14 01:53:26 +0000 |
commit | 0d5bd65e6e468628594d13135912134c4fa26650 (patch) | |
tree | 1ace20991c558944b3c98b0d553227798740518a /tests | |
parent | 924a96651d5dd30559c8420fa27789b248a1b943 (diff) | |
parent | 5ad52ec092cb934760d3a9b693546b4377a92025 (diff) | |
download | android_packages_apps_Trebuchet-0d5bd65e6e468628594d13135912134c4fa26650.tar.gz android_packages_apps_Trebuchet-0d5bd65e6e468628594d13135912134c4fa26650.tar.bz2 android_packages_apps_Trebuchet-0d5bd65e6e468628594d13135912134c4fa26650.zip |
Merge "After switching nav mode, wait for the sysui mode to sync" into ub-launcher3-qt-dev
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 8ebe52565..54b2a017f 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"); } @@ -748,19 +755,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"); } |