Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aedb56fd authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Merge commit 'b02c73d5' into manualmerge

Change-Id: I3ec37c9d45d685c2393087bdefa6ab512cc70062
parents 12e812ea b02c73d5
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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);
}
}
+10 −1
Original line number Original line Diff line number Diff line
@@ -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);


@@ -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;
    }
    }


+28 −2
Original line number Original line Diff line number Diff line
@@ -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();
@@ -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
@@ -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();
@@ -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
+9 −0
Original line number Original line Diff line number Diff line
@@ -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;
+5 −1
Original line number Original line Diff line number Diff line
@@ -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