diff options
author | vadimt <vadimt@google.com> | 2019-04-26 17:28:25 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-04-26 17:28:25 -0700 |
commit | b3a934d98485c05489154ef7ffd06bd3d7a583e0 (patch) | |
tree | 115e44c95e011492cb004291249366b273df2d51 /tests/src/com/android | |
parent | 308f356eb44a19e2e5b532e1803f21be3f1ea98a (diff) | |
download | android_packages_apps_Trebuchet-b3a934d98485c05489154ef7ffd06bd3d7a583e0.tar.gz android_packages_apps_Trebuchet-b3a934d98485c05489154ef7ffd06bd3d7a583e0.tar.bz2 android_packages_apps_Trebuchet-b3a934d98485c05489154ef7ffd06bd3d7a583e0.zip |
Quick for for broken OOP tests
Change-Id: I1009381a58ca28b3ef922f1c6bb872f811f88716
Diffstat (limited to 'tests/src/com/android')
-rw-r--r-- | tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 15402870f..86a576956 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -111,25 +111,27 @@ public abstract class AbstractLauncherUiTest { mLauncher = new LauncherInstrumentation(instrumentation); // b/130558787; b/131419978 - try { - Class systemProps = Class.forName("android.os.SystemProperties"); - Method getInt = systemProps.getMethod("getInt", String.class, int.class); - int apiLevel = (int) getInt.invoke(null, "ro.product.first_api_level", 0); + if (TestHelpers.isInLauncherProcess()) { + try { + Class systemProps = Class.forName("android.os.SystemProperties"); + Method getInt = systemProps.getMethod("getInt", String.class, int.class); + int apiLevel = (int) getInt.invoke(null, "ro.product.first_api_level", 0); - if (apiLevel >= Build.VERSION_CODES.P) { - setActiveOverlay(NAV_BAR_MODE_GESTURAL_OVERLAY, - LauncherInstrumentation.NavigationModel.ZERO_BUTTON); - } - if (apiLevel >= Build.VERSION_CODES.O && apiLevel < Build.VERSION_CODES.P) { - setActiveOverlay(NAV_BAR_MODE_2BUTTON_OVERLAY, - LauncherInstrumentation.NavigationModel.TWO_BUTTON); - } - if (apiLevel < Build.VERSION_CODES.O) { - setActiveOverlay(NAV_BAR_MODE_3BUTTON_OVERLAY, - LauncherInstrumentation.NavigationModel.THREE_BUTTON); + if (apiLevel >= Build.VERSION_CODES.P) { + setActiveOverlay(NAV_BAR_MODE_GESTURAL_OVERLAY, + LauncherInstrumentation.NavigationModel.ZERO_BUTTON); + } + if (apiLevel >= Build.VERSION_CODES.O && apiLevel < Build.VERSION_CODES.P) { + setActiveOverlay(NAV_BAR_MODE_2BUTTON_OVERLAY, + LauncherInstrumentation.NavigationModel.TWO_BUTTON); + } + if (apiLevel < Build.VERSION_CODES.O) { + setActiveOverlay(NAV_BAR_MODE_3BUTTON_OVERLAY, + LauncherInstrumentation.NavigationModel.THREE_BUTTON); + } + } catch (Throwable e) { + e.printStackTrace(); } - } catch (Throwable e) { - e.printStackTrace(); } } |