From 401cde8d99216e807a1b3eb9ffa3d1aa0a81ffc6 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Fri, 11 Aug 2023 18:33:29 -0700 Subject: [PATCH] Adding TaplTestsSplitscreen to OOP tests It's a nice addition to our OOP tests, which serve as a kind-of ssmoke check for the system, as well a a test for a proguarded Launcher. Bug: 187761685 Flag: N/A Test: presubmit Change-Id: I196cf0047f0df6cf843615e48252035f216597a0 --- quickstep/Android.bp | 1 + .../src/com/android/quickstep/TaplTestsSplitscreen.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/quickstep/Android.bp b/quickstep/Android.bp index f5a8253563..638ce27800 100644 --- a/quickstep/Android.bp +++ b/quickstep/Android.bp @@ -42,5 +42,6 @@ filegroup { "tests/src/com/android/quickstep/NavigationModeSwitchRule.java", "tests/src/com/android/quickstep/AbstractQuickStepTest.java", "tests/src/com/android/quickstep/TaplTestsQuickstep.java", + "tests/src/com/android/quickstep/TaplTestsSplitscreen.java", ] } diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java index 3317ce1473..dc7cb9d942 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java @@ -22,6 +22,8 @@ import static org.junit.Assume.assumeTrue; import android.content.Intent; +import androidx.test.platform.app.InstrumentationRegistry; + import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; @@ -36,6 +38,9 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest { private static final String CALCULATOR_APP_PACKAGE = resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR); + private static final String READ_DEVICE_CONFIG_PERMISSION = + "android.permission.READ_DEVICE_CONFIG"; + @Override @Before public void setUp() throws Exception { @@ -46,6 +51,8 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest { mLauncher.enableBlockTimeout(true); mLauncher.showTaskbarIfHidden(); } + InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity( + READ_DEVICE_CONFIG_PERMISSION); } @After