summaryrefslogtreecommitdiff
path: root/cmds
diff options
context:
space:
mode:
authorRicky Wai <rickywai@google.com>2021-01-15 14:06:29 +0000
committerRicky Wai <rickywai@google.com>2021-01-15 14:06:29 +0000
commite81ebc69c354d6741a4468d77c3808c746b9f3e3 (patch)
tree05d9a6e36b184042442299108b7dacb9a843e4d3 /cmds
parent361e0a91a67f32af118ec4fbaabec0aa63055ad1 (diff)
New sm command to unmount app data and obb app visibility mount
This command will be used in tests so tests won't mount data and obb dirs anymore so won't be killed by system when volume is unmounted. Bug: 148049767 Test: Enable storage app visibility flag, then run "sm unmount-app-data-dirs PKG PID USER_ID", data and obb are not mounted in /proc/$PID anymore. Change-Id: Ie5ddf55471f59c61e1906664b87a9bf889702536
Diffstat (limited to 'cmds')
-rw-r--r--cmds/sm/src/com/android/commands/sm/Sm.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java
index c2ee6dcd13b2..405d6f6f5f63 100644
--- a/cmds/sm/src/com/android/commands/sm/Sm.java
+++ b/cmds/sm/src/com/android/commands/sm/Sm.java
@@ -107,6 +107,8 @@ public final class Sm {
runStartCheckpoint();
} else if ("supports-checkpoint".equals(op)) {
runSupportsCheckpoint();
+ } else if ("unmount-app-data-dirs".equals(op)) {
+ runDisableAppDataIsolation();
} else {
throw new IllegalArgumentException();
}
@@ -253,6 +255,13 @@ public final class Sm {
System.out.println(result.get());
}
+ public void runDisableAppDataIsolation() throws RemoteException {
+ final String pkgName = nextArg();
+ final int pid = Integer.parseInt(nextArg());
+ final int userId = Integer.parseInt(nextArg());
+ mSm.disableAppDataIsolation(pkgName, pid, userId);
+ }
+
public void runForget() throws RemoteException {
final String fsUuid = nextArg();
if ("all".equals(fsUuid)) {
@@ -373,6 +382,8 @@ public final class Sm {
System.err.println("");
System.err.println(" sm supports-checkpoint");
System.err.println("");
+ System.err.println(" sm unmount-app-data-dirs PACKAGE_NAME PID USER_ID");
+ System.err.println("");
return 1;
}
}