diff options
author | Artur Satayev <satayev@google.com> | 2019-10-31 12:07:55 +0000 |
---|---|---|
committer | Artur Satayev <satayev@google.com> | 2019-11-12 12:52:19 +0000 |
commit | e2ebc1be4bbc1c6fa2759fce5fc4d47bd4072ee1 (patch) | |
tree | 429378690aa9f1be5be43729f3261498ee51a7fc /cmds/am | |
parent | 423c3a32d6f3aad5484232be208530b05b1116d0 (diff) |
Add --no-test-api-acces to am instrument.
By default instrumented processed have access to @TestApis; however for certain CTS tests we want to disable access to test APIs, where this flag would be used.
Test: manual
Bug: 133832325
Change-Id: Id56ce3079bcea2632d4002edcf120d9d5c9e0a26
Merged-In: Id56ce3079bcea2632d4002edcf120d9d5c9e0a26
Diffstat (limited to 'cmds/am')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 2 | ||||
-rw-r--r-- | cmds/am/src/com/android/commands/am/Instrument.java | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 41d546f6d603..22e1d0187f01 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -174,6 +174,8 @@ public class Am extends BaseCommand { instrument.noWindowAnimation = true; } else if (opt.equals("--no-hidden-api-checks")) { instrument.disableHiddenApiChecks = true; + } else if (opt.equals("--no-test-api-checks")) { + instrument.disableTestApiChecks = true; } else if (opt.equals("--no-isolated-storage")) { instrument.disableIsolatedStorage = true; } else if (opt.equals("--user")) { diff --git a/cmds/am/src/com/android/commands/am/Instrument.java b/cmds/am/src/com/android/commands/am/Instrument.java index 4d7b5a79b4f7..6afd7c40c1c1 100644 --- a/cmds/am/src/com/android/commands/am/Instrument.java +++ b/cmds/am/src/com/android/commands/am/Instrument.java @@ -17,6 +17,7 @@ package com.android.commands.am; import static android.app.ActivityManager.INSTR_FLAG_DISABLE_HIDDEN_API_CHECKS; +import static android.app.ActivityManager.INSTR_FLAG_DISABLE_TEST_API_CHECKS; import static android.app.ActivityManager.INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL; import android.app.IActivityManager; @@ -85,6 +86,7 @@ public class Instrument { String logPath = null; public boolean noWindowAnimation = false; public boolean disableHiddenApiChecks = false; + public boolean disableTestApiChecks = false; public boolean disableIsolatedStorage = false; public String abi = null; public int userId = UserHandle.USER_CURRENT; @@ -506,6 +508,9 @@ public class Instrument { if (disableHiddenApiChecks) { flags |= INSTR_FLAG_DISABLE_HIDDEN_API_CHECKS; } + if (disableTestApiChecks) { + flags |= INSTR_FLAG_DISABLE_TEST_API_CHECKS; + } if (disableIsolatedStorage) { flags |= INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL; } |