From 20d6a27608146c013cf8da1413d828a5cf52bb80 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 17 Jul 2019 11:42:16 -0700 Subject: [PATCH] Use non-android package name for context creation - Speculative fix for mismatch between navigation mode reported to the tests vs. what mode the device is in based on the bug report. Original change to the package name was in ag/6866716 Bug: 136033787 Change-Id: I51f964daa8c42b671733cf3fab19d086e19a9063 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index cc403d48f2..831726b8a5 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -208,7 +208,7 @@ public final class LauncherInstrumentation { try { // Workaround, use constructed context because both the instrumentation context and the // app context are not constructed with resources that take overlays into account - final Context ctx = baseContext.createPackageContext("android", 0); + final Context ctx = baseContext.createPackageContext(getLauncherPackageName(), 0); for (int i = 0; i < 100; ++i) { final int currentInteractionMode = getCurrentInteractionMode(ctx); final NavigationModel model = getNavigationModel(currentInteractionMode); @@ -918,7 +918,7 @@ public final class LauncherInstrumentation { int getEdgeSensitivityWidth() { try { final Context context = mInstrumentation.getTargetContext().createPackageContext( - "android", 0); + getLauncherPackageName(), 0); return context.getResources().getDimensionPixelSize( getSystemDimensionResId(context, "config_backGestureInset")) + 1; } catch (PackageManager.NameNotFoundException e) {