Merge "Remove packageName from vold internal state."
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 0137869..c867d72 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -900,7 +900,8 @@
LOG(VERBOSE) << "destroySandboxForApp: " << packageName << ", sandboxId=" << sandboxId
<< ", userId=" << userId;
auto& userPackages = mUserPackages[userId];
- std::remove(userPackages.begin(), userPackages.end(), packageName);
+ userPackages.erase(std::remove(userPackages.begin(), userPackages.end(), packageName),
+ userPackages.end());
// If the package is not uninstalled in any other users, remove appId and sandboxId
// corresponding to it from the internal state.
bool installedInAnyUser = false;