Loading core/java/android/content/pm/IPackageManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -504,4 +504,5 @@ interface IPackageManager { void grantDefaultPermissions(int userId); void grantDefaultPermissions(int userId); void setCarrierAppPackagesProvider(in IPackagesProvider provider); void setCarrierAppPackagesProvider(in IPackagesProvider provider); int getMountExternalMode(int uid); } } core/java/android/os/Process.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class Process { } } if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) { if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) { argsForZygote.add("--mount-external-default"); argsForZygote.add("--mount-external-default"); } else if (mountExternal == Zygote.MOUNT_EXTERNAL_READ) { argsForZygote.add("--mount-external-read"); } else if (mountExternal == Zygote.MOUNT_EXTERNAL_WRITE) { argsForZygote.add("--mount-external-write"); } } argsForZygote.add("--target-sdk-version=" + targetSdkVersion); argsForZygote.add("--target-sdk-version=" + targetSdkVersion); Loading Loading @@ -802,7 +806,12 @@ public class Process { * @hide * @hide */ */ public static final boolean isIsolated() { public static final boolean isIsolated() { int uid = UserHandle.getAppId(myUid()); return isIsolated(myUid()); } /** {@hide} */ public static final boolean isIsolated(int uid) { uid = UserHandle.getAppId(uid); return uid >= FIRST_ISOLATED_UID && uid <= LAST_ISOLATED_UID; return uid >= FIRST_ISOLATED_UID && uid <= LAST_ISOLATED_UID; } } Loading core/java/android/os/storage/IMountService.java +28 −2 Original line number Original line Diff line number Diff line Loading @@ -1178,6 +1178,21 @@ public interface IMountService extends IInterface { } } } } @Override public void remountUid(int uid) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); mRemote.transact(Stub.TRANSACTION_remountUid, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override @Override public void createNewUserDir(int userHandle, String path) throws RemoteException { public void createNewUserDir(int userHandle, String path) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _data = Parcel.obtain(); Loading Loading @@ -1323,9 +1338,11 @@ public interface IMountService extends IInterface { static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59; static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59; static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60; static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60; static final int TRANSACTION_createNewUserDir = IBinder.FIRST_CALL_TRANSACTION + 61; static final int TRANSACTION_remountUid = IBinder.FIRST_CALL_TRANSACTION + 61; static final int TRANSACTION_deleteUserKey = IBinder.FIRST_CALL_TRANSACTION + 62; static final int TRANSACTION_createNewUserDir = IBinder.FIRST_CALL_TRANSACTION + 62; static final int TRANSACTION_deleteUserKey = IBinder.FIRST_CALL_TRANSACTION + 63; /** /** * Cast an IBinder object into an IMountService interface, generating a * Cast an IBinder object into an IMountService interface, generating a Loading Loading @@ -1880,6 +1897,13 @@ public interface IMountService extends IInterface { reply.writeNoException(); reply.writeNoException(); return true; return true; } } case TRANSACTION_remountUid: { data.enforceInterface(DESCRIPTOR); int uid = data.readInt(); remountUid(uid); reply.writeNoException(); return true; } case TRANSACTION_createNewUserDir: { case TRANSACTION_createNewUserDir: { data.enforceInterface(DESCRIPTOR); data.enforceInterface(DESCRIPTOR); int userHandle = data.readInt(); int userHandle = data.readInt(); Loading Loading @@ -2205,6 +2229,8 @@ public interface IMountService extends IInterface { public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) throws RemoteException; throws RemoteException; public void remountUid(int uid) throws RemoteException; /** /** * Creates the user data directory, possibly encrypted * Creates the user data directory, possibly encrypted * @param userHandle Handle of the user whose directory we are creating * @param userHandle Handle of the user whose directory we are creating Loading core/java/android/os/storage/StorageManager.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -870,6 +870,15 @@ public class StorageManager { throw new IllegalStateException("Missing primary storage"); throw new IllegalStateException("Missing primary storage"); } } /** {@hide} */ public void remountUid(int uid) { try { mMountService.remountUid(uid); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } /** {@hide} */ /** {@hide} */ private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10; private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10; private static final long DEFAULT_THRESHOLD_MAX_BYTES = 500 * MB_IN_BYTES; private static final long DEFAULT_THRESHOLD_MAX_BYTES = 500 * MB_IN_BYTES; Loading core/java/com/android/internal/os/Zygote.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -46,8 +46,12 @@ public final class Zygote { /** No external storage should be mounted. */ /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = 0; public static final int MOUNT_EXTERNAL_NONE = 0; /** Default user-specific external storage should be mounted. */ /** Default external storage should be mounted. */ public static final int MOUNT_EXTERNAL_DEFAULT = 1; public static final int MOUNT_EXTERNAL_DEFAULT = 1; /** Read-only external storage should be mounted. */ public static final int MOUNT_EXTERNAL_READ = 2; /** Read-write external storage should be mounted. */ public static final int MOUNT_EXTERNAL_WRITE = 3; private static final ZygoteHooks VM_HOOKS = new ZygoteHooks(); private static final ZygoteHooks VM_HOOKS = new ZygoteHooks(); Loading Loading
core/java/android/content/pm/IPackageManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -504,4 +504,5 @@ interface IPackageManager { void grantDefaultPermissions(int userId); void grantDefaultPermissions(int userId); void setCarrierAppPackagesProvider(in IPackagesProvider provider); void setCarrierAppPackagesProvider(in IPackagesProvider provider); int getMountExternalMode(int uid); } }
core/java/android/os/Process.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class Process { } } if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) { if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) { argsForZygote.add("--mount-external-default"); argsForZygote.add("--mount-external-default"); } else if (mountExternal == Zygote.MOUNT_EXTERNAL_READ) { argsForZygote.add("--mount-external-read"); } else if (mountExternal == Zygote.MOUNT_EXTERNAL_WRITE) { argsForZygote.add("--mount-external-write"); } } argsForZygote.add("--target-sdk-version=" + targetSdkVersion); argsForZygote.add("--target-sdk-version=" + targetSdkVersion); Loading Loading @@ -802,7 +806,12 @@ public class Process { * @hide * @hide */ */ public static final boolean isIsolated() { public static final boolean isIsolated() { int uid = UserHandle.getAppId(myUid()); return isIsolated(myUid()); } /** {@hide} */ public static final boolean isIsolated(int uid) { uid = UserHandle.getAppId(uid); return uid >= FIRST_ISOLATED_UID && uid <= LAST_ISOLATED_UID; return uid >= FIRST_ISOLATED_UID && uid <= LAST_ISOLATED_UID; } } Loading
core/java/android/os/storage/IMountService.java +28 −2 Original line number Original line Diff line number Diff line Loading @@ -1178,6 +1178,21 @@ public interface IMountService extends IInterface { } } } } @Override public void remountUid(int uid) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); mRemote.transact(Stub.TRANSACTION_remountUid, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override @Override public void createNewUserDir(int userHandle, String path) throws RemoteException { public void createNewUserDir(int userHandle, String path) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _data = Parcel.obtain(); Loading Loading @@ -1323,9 +1338,11 @@ public interface IMountService extends IInterface { static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59; static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59; static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60; static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60; static final int TRANSACTION_createNewUserDir = IBinder.FIRST_CALL_TRANSACTION + 61; static final int TRANSACTION_remountUid = IBinder.FIRST_CALL_TRANSACTION + 61; static final int TRANSACTION_deleteUserKey = IBinder.FIRST_CALL_TRANSACTION + 62; static final int TRANSACTION_createNewUserDir = IBinder.FIRST_CALL_TRANSACTION + 62; static final int TRANSACTION_deleteUserKey = IBinder.FIRST_CALL_TRANSACTION + 63; /** /** * Cast an IBinder object into an IMountService interface, generating a * Cast an IBinder object into an IMountService interface, generating a Loading Loading @@ -1880,6 +1897,13 @@ public interface IMountService extends IInterface { reply.writeNoException(); reply.writeNoException(); return true; return true; } } case TRANSACTION_remountUid: { data.enforceInterface(DESCRIPTOR); int uid = data.readInt(); remountUid(uid); reply.writeNoException(); return true; } case TRANSACTION_createNewUserDir: { case TRANSACTION_createNewUserDir: { data.enforceInterface(DESCRIPTOR); data.enforceInterface(DESCRIPTOR); int userHandle = data.readInt(); int userHandle = data.readInt(); Loading Loading @@ -2205,6 +2229,8 @@ public interface IMountService extends IInterface { public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) throws RemoteException; throws RemoteException; public void remountUid(int uid) throws RemoteException; /** /** * Creates the user data directory, possibly encrypted * Creates the user data directory, possibly encrypted * @param userHandle Handle of the user whose directory we are creating * @param userHandle Handle of the user whose directory we are creating Loading
core/java/android/os/storage/StorageManager.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -870,6 +870,15 @@ public class StorageManager { throw new IllegalStateException("Missing primary storage"); throw new IllegalStateException("Missing primary storage"); } } /** {@hide} */ public void remountUid(int uid) { try { mMountService.remountUid(uid); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } /** {@hide} */ /** {@hide} */ private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10; private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10; private static final long DEFAULT_THRESHOLD_MAX_BYTES = 500 * MB_IN_BYTES; private static final long DEFAULT_THRESHOLD_MAX_BYTES = 500 * MB_IN_BYTES; Loading
core/java/com/android/internal/os/Zygote.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -46,8 +46,12 @@ public final class Zygote { /** No external storage should be mounted. */ /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = 0; public static final int MOUNT_EXTERNAL_NONE = 0; /** Default user-specific external storage should be mounted. */ /** Default external storage should be mounted. */ public static final int MOUNT_EXTERNAL_DEFAULT = 1; public static final int MOUNT_EXTERNAL_DEFAULT = 1; /** Read-only external storage should be mounted. */ public static final int MOUNT_EXTERNAL_READ = 2; /** Read-write external storage should be mounted. */ public static final int MOUNT_EXTERNAL_WRITE = 3; private static final ZygoteHooks VM_HOOKS = new ZygoteHooks(); private static final ZygoteHooks VM_HOOKS = new ZygoteHooks(); Loading