diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp index d8832d3..0053478 100644 --- a/VoldNativeService.cpp +++ b/VoldNativeService.cpp @@ -302,12 +302,14 @@ binder::Status VoldNativeService::partition(const std::string& diskId, int32_t p } } -binder::Status VoldNativeService::forgetPartition(const std::string& partGuid) { +binder::Status VoldNativeService::forgetPartition(const std::string& partGuid, + const std::string& fsUuid) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_HEX(partGuid); + CHECK_ARGUMENT_HEX(fsUuid); ACQUIRE_LOCK; - return translate(VolumeManager::Instance()->forgetPartition(partGuid)); + return translate(VolumeManager::Instance()->forgetPartition(partGuid, fsUuid)); } binder::Status VoldNativeService::mount(const std::string& volId, int32_t mountFlags, diff --git a/VoldNativeService.h b/VoldNativeService.h index dd2b854..8368bdc 100644 --- a/VoldNativeService.h +++ b/VoldNativeService.h @@ -44,7 +44,7 @@ public: binder::Status onUserStopped(int32_t userId); binder::Status partition(const std::string& diskId, int32_t partitionType, int32_t ratio); - binder::Status forgetPartition(const std::string& partGuid); + binder::Status forgetPartition(const std::string& partGuid, const std::string& fsUuid); binder::Status mount(const std::string& volId, int32_t mountFlags, int32_t mountUserId); binder::Status unmount(const std::string& volId); diff --git a/VolumeManager.cpp b/VolumeManager.cpp index befb54d..3194e59 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -293,7 +293,7 @@ void VolumeManager::listVolumes(android::vold::VolumeBase::Type type, } } -int VolumeManager::forgetPartition(const std::string& partGuid) { +int VolumeManager::forgetPartition(const std::string& partGuid, const std::string& fsUuid) { std::string normalizedGuid; if (android::vold::NormalizeHex(partGuid, normalizedGuid)) { LOG(WARNING) << "Invalid GUID " << partGuid; diff --git a/VolumeManager.h b/VolumeManager.h index b66aa2f..8a780c4 100644 --- a/VolumeManager.h +++ b/VolumeManager.h @@ -89,7 +89,7 @@ public: void listVolumes(android::vold::VolumeBase::Type type, std::list& list); - int forgetPartition(const std::string& partGuid); + int forgetPartition(const std::string& partGuid, const std::string& fsUuid); int onUserAdded(userid_t userId, int userSerialNumber); int onUserRemoved(userid_t userId); diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl index d47f113..32d9b16 100644 --- a/binder/android/os/IVold.aidl +++ b/binder/android/os/IVold.aidl @@ -34,7 +34,7 @@ interface IVold { void onUserStopped(int userId); void partition(@utf8InCpp String diskId, int partitionType, int ratio); - void forgetPartition(@utf8InCpp String partGuid); + void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid); void mount(@utf8InCpp String volId, int mountFlags, int mountUserId); void unmount(@utf8InCpp String volId);