Ignore packages whose sandboxes are already created.

Bug: 124788246
Test: manual
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Change-Id: Ie80bbdebc9d3d50e96d2cd17db804b7589b49055
This commit is contained in:
Sudheer Shanka 2019-02-28 10:46:48 -08:00
parent a9ca319cc3
commit 23d725d85a

View file

@ -866,6 +866,12 @@ int VolumeManager::prepareSandboxForApp(const std::string& packageName, appid_t
// be created when the user starts. // be created when the user starts.
return 0; return 0;
} }
auto& userPackages = mUserPackages[userId];
if (std::find(userPackages.begin(), userPackages.end(), packageName) != userPackages.end()) {
return 0;
}
LOG(VERBOSE) << "prepareSandboxForApp: " << packageName << ", appId=" << appId LOG(VERBOSE) << "prepareSandboxForApp: " << packageName << ", appId=" << appId
<< ", sandboxId=" << sandboxId << ", userId=" << userId; << ", sandboxId=" << sandboxId << ", userId=" << userId;
mUserPackages[userId].push_back(packageName); mUserPackages[userId].push_back(packageName);