Check isolated_storage is enabled before cleaning up sandboxes.

Also, clear packages state stored for the user being stopped.

Bug: 117329171
Bug: 111890351
Test: manual
Change-Id: Ida48fcec851830dbb756e329c20c322c631ad264
gugelfrei
Sudheer Shanka 6 years ago
parent cba5a411d1
commit 9acc6d4398

@ -805,6 +805,8 @@ int VolumeManager::onUserStopped(userid_t userId) {
LOG(VERBOSE) << "onUserStopped: " << userId; LOG(VERBOSE) << "onUserStopped: " << userId;
mStartedUsers.erase(userId); mStartedUsers.erase(userId);
if (GetBoolProperty(kIsolatedStorage, false)) {
mUserPackages.erase(userId);
std::string mntTargetDir = StringPrintf("/mnt/user/%d", userId); std::string mntTargetDir = StringPrintf("/mnt/user/%d", userId);
if (android::vold::UnmountTree(mntTargetDir) != 0) { if (android::vold::UnmountTree(mntTargetDir) != 0) {
PLOG(ERROR) << "unmountTree on " << mntTargetDir << " failed"; PLOG(ERROR) << "unmountTree on " << mntTargetDir << " failed";
@ -815,6 +817,7 @@ int VolumeManager::onUserStopped(userid_t userId) {
return -errno; return -errno;
} }
LOG(VERBOSE) << "Success: DeleteDirContentsAndDir on " << mntTargetDir; LOG(VERBOSE) << "Success: DeleteDirContentsAndDir on " << mntTargetDir;
}
return 0; return 0;
} }

Loading…
Cancel
Save