Update vold to handle package info from StorageManagerService.

Bug: 111890351
Test: n/a
Change-Id: I098ad4bc15fae843909d97dad5d301a4e53d51bc
This commit is contained in:
Sudheer Shanka 2018-08-01 01:09:10 -07:00
parent ebaad1c848
commit 62bbb2b1d2
2 changed files with 15 additions and 0 deletions

View file

@ -380,6 +380,7 @@ int VolumeManager::onUserStarted(userid_t userId, const std::vector<std::string>
fs_prepare_dir(path.c_str(), 0755, AID_ROOT, AID_ROOT);
mStartedUsers.insert(userId);
mUserPackages[userId] = packageNames;
if (mPrimary) {
linkPrimary(userId);
}
@ -393,11 +394,17 @@ int VolumeManager::onUserStopped(userid_t userId) {
int VolumeManager::addAppIds(const std::vector<std::string>& packageNames,
const std::vector<int32_t>& appIds) {
for (size_t i = 0; i < packageNames.size(); ++i) {
mAppIds[packageNames[i]] = appIds[i];
}
return 0;
}
int VolumeManager::addSandboxIds(const std::vector<int32_t>& appIds,
const std::vector<std::string>& sandboxIds) {
for (size_t i = 0; i < appIds.size(); ++i) {
mSandboxIds[appIds[i]] = sandboxIds[i];
}
return 0;
}
@ -587,6 +594,10 @@ int VolumeManager::reset() {
updateVirtualDisk();
mAddedUsers.clear();
mStartedUsers.clear();
mUserPackages.clear();
mAppIds.clear();
mSandboxIds.clear();
return 0;
}

View file

@ -160,6 +160,10 @@ private:
std::shared_ptr<android::vold::VolumeBase> mInternalEmulated;
std::shared_ptr<android::vold::VolumeBase> mPrimary;
std::unordered_map<std::string, appid_t> mAppIds;
std::unordered_map<appid_t, std::string> mSandboxIds;
std::unordered_map<userid_t, std::vector<std::string>> mUserPackages;
int mNextObbId;
bool mSecureKeyguardShowing;
};