summaryrefslogtreecommitdiff
path: root/cmds/am/src
diff options
context:
space:
mode:
authorArtur Satayev <satayev@google.com>2019-11-27 15:17:25 +0000
committerArtur Satayev <satayev@google.com>2019-12-04 14:31:07 +0000
commitfdc9fe8dc0af53ae2868bd42145f88ea50ac2925 (patch)
treed28119c8b78050e589ab21153fea237e6d0c0886 /cmds/am/src
parent168c6090855074843b16985fe4efd750a8153d33 (diff)
Swap default for disableTestApiChecks.
There are more runners than those updated in tradefed/testtype/, which donot/cannot push --no-test-api-checks arg to `am instrument`. Instead reverse the default, so that by default `am instrument` disables test api enforcement policy. Test: atest CtsHiddenApiBlacklistApi27TestCases \ CtsHiddenApiBlacklistApi28TestCases \ CtsHiddenApiBlacklistCurrentApiTestCases \ CtsHiddenApiBlacklistDebugClassTestCases \ CtsHiddenApiBlacklistTestApiTestCases \ CtsAppSecurityHostTestCases:android.appsecurity.cts.ExternalStorageHostTest#testMediaEscalation \ CtsAppSecurityHostTestCases:android.appsecurity.cts.StorageHostTest#testVerify \ CtsAppSecurityHostTestCases:android.appsecurity.cts.DirectBootHostTest#testDirectBootNative Exempt-From-Owner-Approval: small fix Bug: 133832325 Change-Id: Id1870cdd4bb0a51bddede24afd7f87d6e5ec766c
Diffstat (limited to 'cmds/am/src')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java6
-rw-r--r--cmds/am/src/com/android/commands/am/Instrument.java2
2 files changed, 6 insertions, 2 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 22e1d0187f01..bdb83804d903 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -175,7 +175,11 @@ public class Am extends BaseCommand {
} else if (opt.equals("--no-hidden-api-checks")) {
instrument.disableHiddenApiChecks = true;
} else if (opt.equals("--no-test-api-checks")) {
- instrument.disableTestApiChecks = true;
+ // TODO(satayev): remove this option, only kept for backwards compatibility with
+ // cached tradefed instance
+ instrument.disableTestApiChecks = false;
+ } else if (opt.equals("--no-test-api-access")) {
+ instrument.disableTestApiChecks = false;
} 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 6afd7c40c1c1..2adbc1f6e1ae 100644
--- a/cmds/am/src/com/android/commands/am/Instrument.java
+++ b/cmds/am/src/com/android/commands/am/Instrument.java
@@ -86,7 +86,7 @@ public class Instrument {
String logPath = null;
public boolean noWindowAnimation = false;
public boolean disableHiddenApiChecks = false;
- public boolean disableTestApiChecks = false;
+ public boolean disableTestApiChecks = true;
public boolean disableIsolatedStorage = false;
public String abi = null;
public int userId = UserHandle.USER_CURRENT;