Loading core/java/android/os/storage/IMountService.java +13 −5 Original line number Diff line number Diff line Loading @@ -169,13 +169,15 @@ public interface IMountService extends IInterface { * is an asynchronous operation. Applications should register * StorageEventListener for storage related status changes. */ public void unmountVolume(String mountPoint, boolean force) throws RemoteException { public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(mountPoint); _data.writeInt((force ? 1 : 0)); _data.writeInt((removeEncryption ? 1 : 0)); mRemote.transact(Stub.TRANSACTION_unmountVolume, _data, _reply, 0); _reply.readException(); } finally { Loading Loading @@ -842,9 +844,9 @@ public interface IMountService extends IInterface { data.enforceInterface(DESCRIPTOR); String mountPoint; mountPoint = data.readString(); boolean force; force = 0 != data.readInt(); unmountVolume(mountPoint, force); boolean force = 0 != data.readInt(); boolean removeEncrypt = 0 != data.readInt(); unmountVolume(mountPoint, force, removeEncrypt); reply.writeNoException(); return true; } Loading Loading @@ -1234,8 +1236,14 @@ public interface IMountService extends IInterface { * Safely unmount external storage at given mount point. The unmount is an * asynchronous operation. Applications should register StorageEventListener * for storage related status changes. * @param mountPoint the mount point * @param force whether or not to forcefully unmount it (e.g. even if programs are using this * data currently) * @param removeEncryption whether or not encryption mapping should be removed from the volume. * This value implies {@code force}. */ public void unmountVolume(String mountPoint, boolean force) throws RemoteException; public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption) throws RemoteException; /** * Unregisters an IMountServiceListener Loading core/java/com/android/internal/os/storage/ExternalStorageFormatter.java +2 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public class ExternalStorageFormatter extends Service Environment.getExternalStorageDirectory().toString() : mStorageVolume.getPath(); try { mountService.unmountVolume(extStoragePath, true); // Remove encryption mapping if this is an unmount for a factory reset. mountService.unmountVolume(extStoragePath, true, mFactoryReset); } catch (RemoteException e) { Log.w(TAG, "Failed talking with mount service", e); } Loading core/tests/coretests/src/android/content/pm/PackageManagerTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -1057,7 +1057,7 @@ public class PackageManagerTests extends AndroidTestCase { try { // Wait on observer synchronized(observer) { getMs().unmountVolume(path, true); getMs().unmountVolume(path, true, false); long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { observer.wait(WAIT_TIME_INCR); Loading core/tests/coretests/src/android/os/storage/AsecTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public class AsecTests extends AndroidTestCase { try { // Wait on observer synchronized(observer) { getMs().unmountVolume(path, false); getMs().unmountVolume(path, false, false); long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { observer.wait(WAIT_TIME_INCR); Loading Loading @@ -486,7 +486,7 @@ public class AsecTests extends AndroidTestCase { // Wait on observer synchronized(observer) { for (int i = 0; i < 5; i++) { getMs().unmountVolume(path, false); getMs().unmountVolume(path, false, false); } long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { Loading include/storage/IMountService.h +2 −2 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ public: virtual void setUsbMassStorageEnabled(const bool enable) = 0; virtual bool isUsbMassStorageEnabled() = 0; virtual int32_t mountVolume(const String16& mountPoint) = 0; virtual int32_t unmountVolume(const String16& mountPoint, const bool force) = 0; virtual int32_t unmountVolume( const String16& mountPoint, const bool force, const bool removeEncryption) = 0; virtual int32_t formatVolume(const String16& mountPoint) = 0; virtual int32_t getStorageUsers(const String16& mountPoint, int32_t** users) = 0; Loading Loading
core/java/android/os/storage/IMountService.java +13 −5 Original line number Diff line number Diff line Loading @@ -169,13 +169,15 @@ public interface IMountService extends IInterface { * is an asynchronous operation. Applications should register * StorageEventListener for storage related status changes. */ public void unmountVolume(String mountPoint, boolean force) throws RemoteException { public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(mountPoint); _data.writeInt((force ? 1 : 0)); _data.writeInt((removeEncryption ? 1 : 0)); mRemote.transact(Stub.TRANSACTION_unmountVolume, _data, _reply, 0); _reply.readException(); } finally { Loading Loading @@ -842,9 +844,9 @@ public interface IMountService extends IInterface { data.enforceInterface(DESCRIPTOR); String mountPoint; mountPoint = data.readString(); boolean force; force = 0 != data.readInt(); unmountVolume(mountPoint, force); boolean force = 0 != data.readInt(); boolean removeEncrypt = 0 != data.readInt(); unmountVolume(mountPoint, force, removeEncrypt); reply.writeNoException(); return true; } Loading Loading @@ -1234,8 +1236,14 @@ public interface IMountService extends IInterface { * Safely unmount external storage at given mount point. The unmount is an * asynchronous operation. Applications should register StorageEventListener * for storage related status changes. * @param mountPoint the mount point * @param force whether or not to forcefully unmount it (e.g. even if programs are using this * data currently) * @param removeEncryption whether or not encryption mapping should be removed from the volume. * This value implies {@code force}. */ public void unmountVolume(String mountPoint, boolean force) throws RemoteException; public void unmountVolume(String mountPoint, boolean force, boolean removeEncryption) throws RemoteException; /** * Unregisters an IMountServiceListener Loading
core/java/com/android/internal/os/storage/ExternalStorageFormatter.java +2 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public class ExternalStorageFormatter extends Service Environment.getExternalStorageDirectory().toString() : mStorageVolume.getPath(); try { mountService.unmountVolume(extStoragePath, true); // Remove encryption mapping if this is an unmount for a factory reset. mountService.unmountVolume(extStoragePath, true, mFactoryReset); } catch (RemoteException e) { Log.w(TAG, "Failed talking with mount service", e); } Loading
core/tests/coretests/src/android/content/pm/PackageManagerTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -1057,7 +1057,7 @@ public class PackageManagerTests extends AndroidTestCase { try { // Wait on observer synchronized(observer) { getMs().unmountVolume(path, true); getMs().unmountVolume(path, true, false); long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { observer.wait(WAIT_TIME_INCR); Loading
core/tests/coretests/src/android/os/storage/AsecTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public class AsecTests extends AndroidTestCase { try { // Wait on observer synchronized(observer) { getMs().unmountVolume(path, false); getMs().unmountVolume(path, false, false); long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { observer.wait(WAIT_TIME_INCR); Loading Loading @@ -486,7 +486,7 @@ public class AsecTests extends AndroidTestCase { // Wait on observer synchronized(observer) { for (int i = 0; i < 5; i++) { getMs().unmountVolume(path, false); getMs().unmountVolume(path, false, false); } long waitTime = 0; while((!observer.isDone()) && (waitTime < MAX_WAIT_TIME) ) { Loading
include/storage/IMountService.h +2 −2 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ public: virtual void setUsbMassStorageEnabled(const bool enable) = 0; virtual bool isUsbMassStorageEnabled() = 0; virtual int32_t mountVolume(const String16& mountPoint) = 0; virtual int32_t unmountVolume(const String16& mountPoint, const bool force) = 0; virtual int32_t unmountVolume( const String16& mountPoint, const bool force, const bool removeEncryption) = 0; virtual int32_t formatVolume(const String16& mountPoint) = 0; virtual int32_t getStorageUsers(const String16& mountPoint, int32_t** users) = 0; Loading