diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 5 | ||||
-rw-r--r-- | cmds/app_process/Android.bp | 9 | ||||
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 18 |
3 files changed, 27 insertions, 5 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index bdb83804d903..846a34eb41c9 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -174,10 +174,6 @@ 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")) { - // 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")) { @@ -198,7 +194,6 @@ public class Am extends BaseCommand { } instrument.componentNameArg = nextArgRequired(); - instrument.run(); } } diff --git a/cmds/app_process/Android.bp b/cmds/app_process/Android.bp index 07221f97c72b..14ebb713b6ae 100644 --- a/cmds/app_process/Android.bp +++ b/cmds/app_process/Android.bp @@ -62,4 +62,13 @@ cc_binary { // Create a symlink from app_process to app_process32 or 64 // depending on the target configuration. symlink_preferred_arch: true, + + // Enable ASYNC MTE in the zygote, in order to allow apps and the system + // server to use MTE. We use ASYNC because we don't expect the pre-fork + // zygote to have substantial memory corruption bugs (as it's primarily Java + // code), and we don't want to waste memory recording malloc/free stack + // traces (which happens in SYNC mode). + sanitize: { + memtag_heap: true, + }, } diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index c2ee6dcd13b2..dc2868a59840 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -20,6 +20,7 @@ import android.os.IVoldTaskListener; import android.os.PersistableBundle; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.SystemProperties; import android.os.storage.DiskInfo; import android.os.storage.IStorageManager; import android.os.storage.StorageManager; @@ -30,6 +31,8 @@ import java.util.concurrent.CompletableFuture; public final class Sm { private static final String TAG = "Sm"; + private static final String ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY = + "persist.sys.vold_app_data_isolation_enabled"; IStorageManager mSm; @@ -107,6 +110,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 +258,17 @@ public final class Sm { System.out.println(result.get()); } + public void runDisableAppDataIsolation() throws RemoteException { + if (!SystemProperties.getBoolean( + ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY, false)) { + throw new IllegalStateException("Storage app data isolation is not enabled."); + } + 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 +389,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; } } |