summaryrefslogtreecommitdiff
path: root/cmds/sm
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2019-02-27 12:09:57 -0700
committerJeff Sharkey <jsharkey@android.com>2019-02-27 12:09:59 -0700
commit36274999fea6843d2e93591f35e42a79d5553d28 (patch)
treebf5cd4f1f536b482dd48a11e432cac6aed515169 /cmds/sm
parentab864c6dd358cb2b54f85ed31603871251e0086e (diff)
Developer option to disable legacy greylist.
The app developers on the legacy greylist need an option to disable the greylist so they can debug. Bug: 124818022 Test: manual Change-Id: I84785a235830761794dee5c603c1ea43f8ace73e
Diffstat (limited to 'cmds/sm')
-rw-r--r--cmds/sm/src/com/android/commands/sm/Sm.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java
index be5a5bf6c35a..4a6f87f09d29 100644
--- a/cmds/sm/src/com/android/commands/sm/Sm.java
+++ b/cmds/sm/src/com/android/commands/sm/Sm.java
@@ -103,6 +103,8 @@ public final class Sm {
runSetVirtualDisk();
} else if ("set-isolated-storage".equals(op)) {
runIsolatedStorage();
+ } else if ("set-legacy-greylist".equals(op)) {
+ runLegacyGreylist();
} else {
throw new IllegalArgumentException();
}
@@ -282,7 +284,7 @@ public final class Sm {
StorageManager.DEBUG_VIRTUAL_DISK);
}
- public void runIsolatedStorage() {
+ public void runIsolatedStorage() throws RemoteException {
final int value;
final int mask = StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_ON
| StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_OFF;
@@ -301,16 +303,13 @@ public final class Sm {
default:
return;
}
+ mSm.setDebugFlags(value, mask);
+ }
- // Toggling isolated-storage state will result in a device reboot. So to avoid this command
- // from erroring out (DeadSystemException), call setDebugFlags() in a separate thread.
- new Thread(() -> {
- try {
- mSm.setDebugFlags(value, mask);
- } catch (RemoteException e) {
- Log.e(TAG, "Encountered an error!", e);
- }
- }).start();
+ public void runLegacyGreylist() throws RemoteException {
+ final boolean legacyGreylist = Boolean.parseBoolean(nextArg());
+ mSm.setDebugFlags(legacyGreylist ? StorageManager.DEBUG_LEGACY_GREYLIST : 0,
+ StorageManager.DEBUG_LEGACY_GREYLIST);
}
public void runIdleMaint() throws RemoteException {