const bf::path& root_path, uid_t uid, bool is_preload) {
std::vector<bf::path> locations;
// FIXME: icons for preloaded apps should also be moved to "shared/res"
- bf::path system_location = bf::path(getIconPath(uid, is_preload)) / filename;
- bf::path small_system_location =
- bf::path(getIconPath(uid, is_preload)) / "default" / "small" / filename;
+ const char* extra_icon_path = getIconPath(uid, is_preload);
+ if (extra_icon_path) {
+ bf::path system_location = bf::path(extra_icon_path) / filename;
+ bf::path small_system_location =
+ bf::path(extra_icon_path) / "default" / "small" / filename;
+ locations.push_back(system_location);
+ locations.push_back(small_system_location);
+ }
bf::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
-
- locations.push_back(system_location);
- locations.push_back(small_system_location);
locations.push_back(res_icons_location);
for (auto& location : locations) {
bf::path manifest_path =
bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
- bf::path icon_path =
- bf::path(getIconPath(getuid(), false)) / (appid + ".png");
ASSERT_TRUE(bf::exists(manifest_path));
- ASSERT_TRUE(bf::exists(icon_path));
// backups should not exist
bf::path package_backup = ci::GetBackupPathForPackagePath(package_path);
bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path);
- bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path);
ASSERT_FALSE(bf::exists(package_backup));
ASSERT_FALSE(bf::exists(manifest_backup));
- ASSERT_FALSE(bf::exists(icon_backup));
}
void PackageCheckCleanup(const std::string& pkgid, const std::string& appid) {
bf::path manifest_path =
bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
- bf::path icon_path =
- bf::path(getIconPath(getuid(), false)) / (appid + ".png");
ASSERT_FALSE(bf::exists(manifest_path));
- ASSERT_FALSE(bf::exists(icon_path));
// backups should not exist
bf::path package_backup = ci::GetBackupPathForPackagePath(package_path);
bf::path manifest_backup = ci::GetBackupPathForManifestFile(manifest_path);
- bf::path icon_backup = ci::GetBackupPathForIconFile(icon_path);
ASSERT_FALSE(bf::exists(package_backup));
ASSERT_FALSE(bf::exists(manifest_backup));
- ASSERT_FALSE(bf::exists(icon_backup));
}
void ValidatePackage(const std::string& pkgid, const std::string& appid) {