From 5616670a5aee8807cddfd5d9dfe7585e1dffbff5 Mon Sep 17 00:00:00 2001 From: vadimt Date: Fri, 15 Feb 2019 18:04:54 -0800 Subject: [PATCH] Fixing swipe-up mode recognition in TAPL It failed on Cuttlefish Change-Id: I81e168f133d51d7c140897cd6847bf30da608d70 --- .../launcher3/tapl/LauncherInstrumentation.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 1e14e27818..7473189107 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -104,13 +104,13 @@ public final class LauncherInstrumentation { public LauncherInstrumentation(Instrumentation instrumentation) { mInstrumentation = instrumentation; mDevice = UiDevice.getInstance(instrumentation); - final boolean swipeUpEnabledDefault = - !SwipeUpSetting.isSwipeUpSettingAvailable() || - SwipeUpSetting.isSwipeUpEnabledDefaultValue(); - mSwipeUpEnabled = Settings.Secure.getInt( - instrumentation.getTargetContext().getContentResolver(), - SWIPE_UP_SETTING_NAME, - swipeUpEnabledDefault ? 1 : 0) == 1; + final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue(); + mSwipeUpEnabled = SwipeUpSetting.isSwipeUpSettingAvailable() ? + Settings.Secure.getInt( + instrumentation.getTargetContext().getContentResolver(), + SWIPE_UP_SETTING_NAME, + swipeUpEnabledDefaultValue ? 1 : 0) == 1 : + swipeUpEnabledDefaultValue; // Launcher should run in test harness so that custom accessibility protocol between // Launcher and TAPL is enabled. In-process tests enable this protocol with a direct call