Loading api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -3941,7 +3941,8 @@ package android.app { method public boolean isBackgroundRestricted(); method @Deprecated public boolean isInLockTaskMode(); method public boolean isLowRamDevice(); method public static boolean isRunningInTestHarness(); method @Deprecated public static boolean isRunningInTestHarness(); method public static boolean isRunningInUserTestHarness(); method public static boolean isUserAMonkey(); method @RequiresPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES) public void killBackgroundProcesses(String); method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int); core/java/android/app/ActivityManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -3529,11 +3529,31 @@ public class ActivityManager { /** * Returns "true" if device is running in a test harness. * * @deprecated this method is false for all user builds. Users looking to check if their device * is running in a device farm should see {@link #isRunningInUserTestHarness()}. */ @Deprecated public static boolean isRunningInTestHarness() { return SystemProperties.getBoolean("ro.test_harness", false); } /** * Returns "true" if the device is running in Test Harness Mode. * * <p>Test Harness Mode is a feature that allows devices to run without human interaction in a * device farm/testing harness (such as Firebase Test Lab). You should check this method if you * want your app to behave differently when running in a test harness to skip setup screens that * would impede UI testing. e.g. a keyboard application that has a full screen setup page for * the first time it is launched. * * <p>Note that you should <em>not</em> use this to determine whether or not your app is running * an instrumentation test, as it is not set for a standard device running a test. */ public static boolean isRunningInUserTestHarness() { return SystemProperties.getBoolean("persist.sys.test_harness", false); } /** * Unsupported compiled sdk warning should always be shown for the intput activity * even in cases where the system would normally not show the warning. E.g. when running in a Loading core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1748,6 +1748,10 @@ <permission android:name="android.permission.MANAGE_BLUETOOTH_WHEN_WIRELESS_CONSENT_REQUIRED" android:protectionLevel="signature" /> <!-- @hide Allows the device to be reset, clearing all data and enables Test Harness Mode. --> <permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" android:protectionLevel="signature" /> <!-- ================================== --> <!-- Permissions for accessing accounts --> <!-- ================================== --> Loading packages/Shell/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ <uses-permission android:name="android.permission.CONTROL_KEYGUARD" /> <uses-permission android:name="android.permission.SUSPEND_APPS" /> <uses-permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND" /> <!-- Permission needed to wipe the device for Test Harness Mode --> <uses-permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" /> <uses-permission android:name="android.permission.MANAGE_APPOPS" /> Loading services/core/java/com/android/server/PersistentDataBlockManagerInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,19 @@ public interface PersistentDataBlockManagerInternal { */ byte[] getFrpCredentialHandle(); /** Stores the data used to enable the Test Harness Mode after factory-resetting. */ void setTestHarnessModeData(byte[] data); /** * Retrieves the data used to place the device into Test Harness Mode. * * @throws IllegalStateException if the underlying storage is corrupt or inaccessible. */ byte[] getTestHarnessModeData(); /** Clear out the Test Harness Mode data. */ void clearTestHarnessModeData(); /** Update the OEM unlock enabled bit, bypassing user restriction checks. */ void forceOemUnlockEnabled(boolean enabled); } Loading
api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -3941,7 +3941,8 @@ package android.app { method public boolean isBackgroundRestricted(); method @Deprecated public boolean isInLockTaskMode(); method public boolean isLowRamDevice(); method public static boolean isRunningInTestHarness(); method @Deprecated public static boolean isRunningInTestHarness(); method public static boolean isRunningInUserTestHarness(); method public static boolean isUserAMonkey(); method @RequiresPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES) public void killBackgroundProcesses(String); method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int);
core/java/android/app/ActivityManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -3529,11 +3529,31 @@ public class ActivityManager { /** * Returns "true" if device is running in a test harness. * * @deprecated this method is false for all user builds. Users looking to check if their device * is running in a device farm should see {@link #isRunningInUserTestHarness()}. */ @Deprecated public static boolean isRunningInTestHarness() { return SystemProperties.getBoolean("ro.test_harness", false); } /** * Returns "true" if the device is running in Test Harness Mode. * * <p>Test Harness Mode is a feature that allows devices to run without human interaction in a * device farm/testing harness (such as Firebase Test Lab). You should check this method if you * want your app to behave differently when running in a test harness to skip setup screens that * would impede UI testing. e.g. a keyboard application that has a full screen setup page for * the first time it is launched. * * <p>Note that you should <em>not</em> use this to determine whether or not your app is running * an instrumentation test, as it is not set for a standard device running a test. */ public static boolean isRunningInUserTestHarness() { return SystemProperties.getBoolean("persist.sys.test_harness", false); } /** * Unsupported compiled sdk warning should always be shown for the intput activity * even in cases where the system would normally not show the warning. E.g. when running in a Loading
core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1748,6 +1748,10 @@ <permission android:name="android.permission.MANAGE_BLUETOOTH_WHEN_WIRELESS_CONSENT_REQUIRED" android:protectionLevel="signature" /> <!-- @hide Allows the device to be reset, clearing all data and enables Test Harness Mode. --> <permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" android:protectionLevel="signature" /> <!-- ================================== --> <!-- Permissions for accessing accounts --> <!-- ================================== --> Loading
packages/Shell/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ <uses-permission android:name="android.permission.CONTROL_KEYGUARD" /> <uses-permission android:name="android.permission.SUSPEND_APPS" /> <uses-permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND" /> <!-- Permission needed to wipe the device for Test Harness Mode --> <uses-permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" /> <uses-permission android:name="android.permission.MANAGE_APPOPS" /> Loading
services/core/java/com/android/server/PersistentDataBlockManagerInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,19 @@ public interface PersistentDataBlockManagerInternal { */ byte[] getFrpCredentialHandle(); /** Stores the data used to enable the Test Harness Mode after factory-resetting. */ void setTestHarnessModeData(byte[] data); /** * Retrieves the data used to place the device into Test Harness Mode. * * @throws IllegalStateException if the underlying storage is corrupt or inaccessible. */ byte[] getTestHarnessModeData(); /** Clear out the Test Harness Mode data. */ void clearTestHarnessModeData(); /** Update the OEM unlock enabled bit, bypassing user restriction checks. */ void forceOemUnlockEnabled(boolean enabled); }