Remove packageName from vold internal state.
std::remove will only move the matching items to the end, there
should be an erase call after that to actually get rid of those
items from the container.
Test: manual
Change-Id: I7d3b48f77fa5fab703fb10cf429d8c183322ed29
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;