Loading core/java/android/os/storage/IMountService.java +5 −3 Original line number Diff line number Diff line Loading @@ -625,12 +625,13 @@ public interface IMountService extends IInterface { return _result; } public int encryptStorage(String password) throws RemoteException { public int encryptStorage(int type, String password) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(type); _data.writeString(password); mRemote.transact(Stub.TRANSACTION_encryptStorage, _data, _reply, 0); _reply.readException(); Loading Loading @@ -1210,8 +1211,9 @@ public interface IMountService extends IInterface { } case TRANSACTION_encryptStorage: { data.enforceInterface(DESCRIPTOR); int type = data.readInt(); String password = data.readString(); int result = encryptStorage(password); int result = encryptStorage(type, password); reply.writeNoException(); reply.writeInt(result); return true; Loading Loading @@ -1495,7 +1497,7 @@ public interface IMountService extends IInterface { /** * Encrypts storage. */ public int encryptStorage(String password) throws RemoteException; public int encryptStorage(int type, String password) throws RemoteException; /** * Changes the encryption password. Loading services/core/java/com/android/server/MountService.java +4 −3 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import android.os.storage.IMountServiceListener; import android.os.storage.IMountShutdownObserver; import android.os.storage.IObbActionListener; import android.os.storage.OnObbStateChangeListener; import android.os.storage.StorageManager; import android.os.storage.StorageResultCode; import android.os.storage.StorageVolume; import android.text.TextUtils; Loading Loading @@ -2145,8 +2146,8 @@ class MountService extends IMountService.Stub } } public int encryptStorage(String password) { if (TextUtils.isEmpty(password)) { public int encryptStorage(int type, String password) { if (TextUtils.isEmpty(password) && type != StorageManager.CRYPT_TYPE_DEFAULT) { throw new IllegalArgumentException("password cannot be empty"); } Loading @@ -2160,7 +2161,7 @@ class MountService extends IMountService.Stub } try { mConnector.execute("cryptfs", "enablecrypto", "inplace", mConnector.execute("cryptfs", "enablecrypto", "inplace", CRYPTO_TYPES[type], new SensitiveArg(toHex(password))); } catch (NativeDaemonConnectorException e) { // Encryption failed Loading Loading
core/java/android/os/storage/IMountService.java +5 −3 Original line number Diff line number Diff line Loading @@ -625,12 +625,13 @@ public interface IMountService extends IInterface { return _result; } public int encryptStorage(String password) throws RemoteException { public int encryptStorage(int type, String password) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(type); _data.writeString(password); mRemote.transact(Stub.TRANSACTION_encryptStorage, _data, _reply, 0); _reply.readException(); Loading Loading @@ -1210,8 +1211,9 @@ public interface IMountService extends IInterface { } case TRANSACTION_encryptStorage: { data.enforceInterface(DESCRIPTOR); int type = data.readInt(); String password = data.readString(); int result = encryptStorage(password); int result = encryptStorage(type, password); reply.writeNoException(); reply.writeInt(result); return true; Loading Loading @@ -1495,7 +1497,7 @@ public interface IMountService extends IInterface { /** * Encrypts storage. */ public int encryptStorage(String password) throws RemoteException; public int encryptStorage(int type, String password) throws RemoteException; /** * Changes the encryption password. Loading
services/core/java/com/android/server/MountService.java +4 −3 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import android.os.storage.IMountServiceListener; import android.os.storage.IMountShutdownObserver; import android.os.storage.IObbActionListener; import android.os.storage.OnObbStateChangeListener; import android.os.storage.StorageManager; import android.os.storage.StorageResultCode; import android.os.storage.StorageVolume; import android.text.TextUtils; Loading Loading @@ -2145,8 +2146,8 @@ class MountService extends IMountService.Stub } } public int encryptStorage(String password) { if (TextUtils.isEmpty(password)) { public int encryptStorage(int type, String password) { if (TextUtils.isEmpty(password) && type != StorageManager.CRYPT_TYPE_DEFAULT) { throw new IllegalArgumentException("password cannot be empty"); } Loading @@ -2160,7 +2161,7 @@ class MountService extends IMountService.Stub } try { mConnector.execute("cryptfs", "enablecrypto", "inplace", mConnector.execute("cryptfs", "enablecrypto", "inplace", CRYPTO_TYPES[type], new SensitiveArg(toHex(password))); } catch (NativeDaemonConnectorException e) { // Encryption failed Loading