Update vold to handle package info from StorageManagerService.
Bug: 111890351 Test: n/a Change-Id: I098ad4bc15fae843909d97dad5d301a4e53d51bc
This commit is contained in:
parent
ebaad1c848
commit
62bbb2b1d2
2 changed files with 15 additions and 0 deletions
|
@ -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);
|
fs_prepare_dir(path.c_str(), 0755, AID_ROOT, AID_ROOT);
|
||||||
|
|
||||||
mStartedUsers.insert(userId);
|
mStartedUsers.insert(userId);
|
||||||
|
mUserPackages[userId] = packageNames;
|
||||||
if (mPrimary) {
|
if (mPrimary) {
|
||||||
linkPrimary(userId);
|
linkPrimary(userId);
|
||||||
}
|
}
|
||||||
|
@ -393,11 +394,17 @@ int VolumeManager::onUserStopped(userid_t userId) {
|
||||||
|
|
||||||
int VolumeManager::addAppIds(const std::vector<std::string>& packageNames,
|
int VolumeManager::addAppIds(const std::vector<std::string>& packageNames,
|
||||||
const std::vector<int32_t>& appIds) {
|
const std::vector<int32_t>& appIds) {
|
||||||
|
for (size_t i = 0; i < packageNames.size(); ++i) {
|
||||||
|
mAppIds[packageNames[i]] = appIds[i];
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int VolumeManager::addSandboxIds(const std::vector<int32_t>& appIds,
|
int VolumeManager::addSandboxIds(const std::vector<int32_t>& appIds,
|
||||||
const std::vector<std::string>& sandboxIds) {
|
const std::vector<std::string>& sandboxIds) {
|
||||||
|
for (size_t i = 0; i < appIds.size(); ++i) {
|
||||||
|
mSandboxIds[appIds[i]] = sandboxIds[i];
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -587,6 +594,10 @@ int VolumeManager::reset() {
|
||||||
updateVirtualDisk();
|
updateVirtualDisk();
|
||||||
mAddedUsers.clear();
|
mAddedUsers.clear();
|
||||||
mStartedUsers.clear();
|
mStartedUsers.clear();
|
||||||
|
|
||||||
|
mUserPackages.clear();
|
||||||
|
mAppIds.clear();
|
||||||
|
mSandboxIds.clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,10 @@ private:
|
||||||
std::shared_ptr<android::vold::VolumeBase> mInternalEmulated;
|
std::shared_ptr<android::vold::VolumeBase> mInternalEmulated;
|
||||||
std::shared_ptr<android::vold::VolumeBase> mPrimary;
|
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;
|
int mNextObbId;
|
||||||
bool mSecureKeyguardShowing;
|
bool mSecureKeyguardShowing;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue