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
This commit is contained in:
Sudheer Shanka 2018-12-16 18:22:34 -08:00
parent 2717699b49
commit ba0c62f752

View file

@ -900,7 +900,8 @@ int VolumeManager::destroySandboxForApp(const std::string& packageName,
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;