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

Commit 941d2edd authored by Kenny Root's avatar Kenny Root Committed by Android Git Automerger
Browse files

am 7a7d8f18: am bad417df: Merge "Throw RemoteException when MountService is not yet up" into jb-dev

* commit '7a7d8f18':
  Throw RemoteException when MountService is not yet up
parents 610ac933 7a7d8f18
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -57,25 +57,25 @@ public class PackageHelper {
    public static final int APP_INSTALL_INTERNAL = 1;
    public static final int APP_INSTALL_INTERNAL = 1;
    public static final int APP_INSTALL_EXTERNAL = 2;
    public static final int APP_INSTALL_EXTERNAL = 2;


    public static IMountService getMountService() {
    public static IMountService getMountService() throws RemoteException {
        IBinder service = ServiceManager.getService("mount");
        IBinder service = ServiceManager.getService("mount");
        if (service != null) {
        if (service != null) {
            return IMountService.Stub.asInterface(service);
            return IMountService.Stub.asInterface(service);
        } else {
        } else {
            Log.e(TAG, "Can't get mount service");
            Log.e(TAG, "Can't get mount service");
            throw new RemoteException("Could not contact mount service");
        }
        }
        return null;
    }
    }


    public static String createSdDir(int sizeMb, String cid, String sdEncKey, int uid,
    public static String createSdDir(int sizeMb, String cid, String sdEncKey, int uid,
            boolean isExternal) {
            boolean isExternal) {
        // Create mount point via MountService
        // Create mount point via MountService
        try {
            IMountService mountService = getMountService();
            IMountService mountService = getMountService();


            if (localLOGV)
            if (localLOGV)
                Log.i(TAG, "Size of container " + sizeMb + " MB");
                Log.i(TAG, "Size of container " + sizeMb + " MB");


        try {
            int rc = mountService.createSecureContainer(cid, sizeMb, "ext4", sdEncKey, uid,
            int rc = mountService.createSecureContainer(cid, sizeMb, "ext4", sdEncKey, uid,
                    isExternal);
                    isExternal);
            if (rc != StorageResultCode.OperationSucceeded) {
            if (rc != StorageResultCode.OperationSucceeded) {