if (request_type_ == ci::RequestType::Uninstall) {
if (!SendAppids(type, pkgid))
return false;
- for (auto l : user_list_)
+ for (const auto& l : user_list_)
SendAppids(l.first, type, pkgid);
}
if (!SendSignal(PKGMGR_INSTALLER_INSTALL_PERCENT_KEY_STR,
std::to_string(progress).c_str(), type, pkgid))
return false;
- for (auto l : user_list_) {
+ for (const auto& l : user_list_) {
// ignore error case
SendSignal(l.first, PKGMGR_INSTALLER_INSTALL_PERCENT_KEY_STR,
std::to_string(progress).c_str(), type, pkgid);
PKGMGR_INSTALLER_END_KEY_STR, GetResultKey(result), type, pkgid))
return false;
- for (auto l : user_list_)
+ for (const auto& l : user_list_)
SendSignal(l.first,
PKGMGR_INSTALLER_END_KEY_STR, GetResultKey(result), type, pkgid);
type,
pkgid))
return false;
- for (auto l : user_list_)
+ for (const auto& l : user_list_)
SendSignal(l.first,
PKGMGR_INSTALLER_ERROR_KEY_STR,
error_value.c_str(),
return false;
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
if (!ci::RemoveAll(path / entry / pkgid))
return false;
}
bool PerformExternalDirectoryCreationForAllUsers(const std::string& pkgid) {
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
if (!PerformExternalDirectoryCreationForUser(std::get<0>(l),
pkgid))
LOG(WARNING) << "Could not create external storage directories for user: "
bool PerformExternalDirectoryCreationForAllPkgs() {
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
pkgmgrinfo_pkginfo_filter_h filter_handle = nullptr;
int ret = pkgmgrinfo_pkginfo_filter_create(&filter_handle);
bool PerformExternalDirectoryDeletionForAllUsers(const std::string& pkgid) {
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
ci::PkgQueryInterface pkg_query(pkgid, uid);
LOG(DEBUG) << "Deleting directories for user: " << uid;
// create per user dir
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = std::get<2>(l) / "apps_rw";
std::vector<bf::path> apps_rw_paths;
if (shareddata) {
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
bf::path shared_dst = apps_rw / entry / pkgid;
if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid))
return false;
// delete per user dir
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = std::get<2>(l) / "apps_rw";
std::vector<bf::path> apps_rw_paths;
if (shareddata) {
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
bf::path shared_dst = path / entry / pkgid;
if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid))
return false;
bool DeleteUserExternalDirectories(const std::string& pkgid) {
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
ci::PkgQueryInterface pkg_query(pkgid, uid);
if (pkg_query.IsPackageInstalled()) {
}
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
LOG(DEBUG) << "Creating symlinks for uid: " << uid;
// check installed user private app.
}
UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
LOG(DEBUG) << "Deleting symlinks for uid: " << uid;
// create per user dir
ci::UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
LOG(DEBUG) << "Adding shareddata directory for uid: " << uid;
return false;
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
bf::path shared_dst = apps_rw / entry / pkgid;
if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid))
return false;
return false;
ci::UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = ci::GetRootAppPath(false, uid);
return false;
ci::UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = ci::GetRootAppPath(false, uid);
std::vector<bf::path> apps_rw_paths;
return false;
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
bf::path shared_dst = apps_rw / entry / pkgid;
if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid))
return false;
std::string error_message;
ci::UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = ci::GetRootAppPath(false, uid);
std::vector<bf::path> apps_rw_paths;
return false;
std::vector<std::string> shared_dirs(kSharedDataEntries);
- for (auto entry : shared_dirs) {
+ for (const auto& entry : shared_dirs) {
bf::path shared_dst = apps_rw / entry / pkgid;
if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid))
return false;
return false;
ci::UserList list = ci::GetUserList();
- for (auto l : list) {
+ for (const auto& l : list) {
uid_t uid = std::get<0>(l);
bf::path owner_apps_rw = ci::GetRootAppPath(false, uid);
std::vector<bf::path> apps_rw_paths;