Delete package sandbox data when it is uninstalled.
Bug: 111890351
Test: manual
Change-Id: I989d507f3352959e824b161a94c0eaad6eed9bba
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 5544c81..fbdce7e 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -886,17 +886,28 @@
return translateBool(e4crypt_destroy_user_storage(uuid_, userId, flags));
}
-binder::Status VoldNativeService::mountExternalStorageForApp(const std::string& packageName,
- int32_t appId,
- const std::string& sandboxId,
- int32_t userId) {
+binder::Status VoldNativeService::prepareSandboxForApp(const std::string& packageName,
+ int32_t appId, const std::string& sandboxId,
+ int32_t userId) {
ENFORCE_UID(AID_SYSTEM);
CHECK_ARGUMENT_PACKAGE_NAME(packageName);
CHECK_ARGUMENT_SANDBOX_ID(sandboxId);
ACQUIRE_LOCK;
- return translate(VolumeManager::Instance()->mountExternalStorageForApp(packageName, appId,
- sandboxId, userId));
+ return translate(
+ VolumeManager::Instance()->prepareSandboxForApp(packageName, appId, sandboxId, userId));
+}
+
+binder::Status VoldNativeService::destroySandboxForApp(const std::string& packageName,
+ int32_t appId, const std::string& sandboxId,
+ int32_t userId) {
+ ENFORCE_UID(AID_SYSTEM);
+ CHECK_ARGUMENT_PACKAGE_NAME(packageName);
+ CHECK_ARGUMENT_SANDBOX_ID(sandboxId);
+ ACQUIRE_LOCK;
+
+ return translate(
+ VolumeManager::Instance()->destroySandboxForApp(packageName, appId, sandboxId, userId));
}
binder::Status VoldNativeService::startCheckpoint(int32_t retry, bool* _aidl_return) {