summaryrefslogtreecommitdiffstats
path: root/tests/tapl
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2019-03-27 02:50:38 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-27 02:50:38 +0000
commite5af8f390ac82a7e4ca08baace9fcb3b6c8c6cb6 (patch)
treef4f28404ed4e801c335b4138756c2dbc98c4b616 /tests/tapl
parent522cc2ff0c2eca5414302ab8262efffb2256f43e (diff)
parenta5354e02a2bf2bd8b0907b9e34dfbfddd9e679be (diff)
downloadandroid_packages_apps_Trebuchet-e5af8f390ac82a7e4ca08baace9fcb3b6c8c6cb6.tar.gz
android_packages_apps_Trebuchet-e5af8f390ac82a7e4ca08baace9fcb3b6c8c6cb6.tar.bz2
android_packages_apps_Trebuchet-e5af8f390ac82a7e4ca08baace9fcb3b6c8c6cb6.zip
Merge changes from topics "launcher_nav_changes", "nav-bar-mode-fw-overlay-ub-launcher3-master" into ub-launcher3-master
* changes: Use system recent tasks stabilization Use own context instead of app context to get overlay resources Updating to nav bar mode
Diffstat (limited to 'tests/tapl')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 19b368f4f..fd6ddce5d 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -17,20 +17,19 @@
package com.android.launcher3.tapl;
import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
-import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING_NAME;
import android.app.ActivityManager;
import android.app.Instrumentation;
import android.app.UiAutomation;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.graphics.Point;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.SystemClock;
-import android.provider.Settings;
import android.util.Log;
import android.view.InputDevice;
import android.view.MotionEvent;
@@ -48,7 +47,7 @@ import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
import com.android.launcher3.TestProtocol;
-import com.android.quickstep.SwipeUpSetting;
+import com.android.systemui.shared.system.QuickStepContract;
import org.junit.Assert;
@@ -175,13 +174,15 @@ public final class LauncherInstrumentation {
}
private boolean isSwipeUpEnabled() {
- final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue();
- return SwipeUpSetting.isSwipeUpSettingAvailable() ?
- Settings.Secure.getInt(
- mInstrumentation.getTargetContext().getContentResolver(),
- SWIPE_UP_SETTING_NAME,
- swipeUpEnabledDefaultValue ? 1 : 0) == 1 :
- swipeUpEnabledDefaultValue;
+ final Context baseContext = mInstrumentation.getTargetContext();
+ try {
+ // Workaround, use constructed context because both the instrumentation context and the
+ // app context are not constructed with resources that take overlays into account
+ Context ctx = baseContext.createPackageContext(getLauncherPackageName(), 0);
+ return !QuickStepContract.isLegacyMode(ctx);
+ } catch (PackageManager.NameNotFoundException e) {
+ return false;
+ }
}
static void log(String message) {