Add instrumentation flag to get access to full exteranl storage.

When starting a process under instrumentation using this new
"--no-isolated-storage" flag, the process would be able to see the
full external storage.

Bug: 117229024
Test: adb shell am instrument --no-isolated-storage \
      -e class android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBuffer720p \
      -w android.media.cts/android.test.InstrumentationTestRunner
Change-Id: I7973b123cf4fc08e8ce2b05bd4c23fa41b1cdcdf
This commit is contained in:
Sudheer Shanka
2018-10-21 16:19:53 -07:00
parent 5b3a6a8187
commit 8f99bff2e4
6 changed files with 80 additions and 50 deletions

View File

@@ -137,6 +137,17 @@ public class ActivityManager {
private static final int FIRST_START_NON_FATAL_ERROR_CODE = 100;
private static final int LAST_START_NON_FATAL_ERROR_CODE = 199;
/**
* Disable hidden API checks for the newly started instrumentation.
* @hide
*/
public static final int INSTR_FLAG_DISABLE_HIDDEN_API_CHECKS = 1 << 0;
/**
* Mount full external storage for the newly started instrumentation.
* @hide
*/
public static final int INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL = 1 << 1;
static final class UidObserver extends IUidObserver.Stub {
final OnUidImportanceListener mListener;
final Context mContext;