if (!ConvertXml(doc))
return Step::Status::MANIFEST_ERROR;
- bf::path new_path = bf::path(getUserManifestPath(context_->uid.get()))
+ bf::path new_path =
+ bf::path(getUserManifestPath(context_->uid.get(),
+ context_->is_preload_request.get()))
/ bf::path(context_->pkgid.get());
new_path += ".xml";
if (!bf::exists(new_path.parent_path())) {
#include "common/pkgmgr_interface.h"
#include "common/utils/file_util.h"
-namespace {
-const char kPathManifestPrefix[] = "/usr/share/packages";
-}
-
namespace common_installer {
namespace tpk {
// This function checks for alternative locations of icon file of tpk package
bf::path LocateIcon(const bf::path& filename, const std::string& pkgid,
- const bf::path& root_path, uid_t uid) {
+ 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)) / filename;
+ bf::path system_location = bf::path(getIconPath(uid, is_preload)) / filename;
bf::path small_system_location =
- bf::path(getIconPath(uid)) / "default" / "small" / filename;
+ bf::path(getIconPath(uid, is_preload)) / "default" / "small" / filename;
bf::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
locations.push_back(system_location);
bf::path source = LocateIcon(icon_text.filename(),
context_->pkgid.get(),
context_->root_application_path.get(),
- context_->uid.get());
+ context_->uid.get(),
+ context_->is_preload_request.get());
if (!source.empty()) {
LOG(DEBUG) << "Fix location of icon: " << source << " to: " << icon_text;
if (!common_installer::CopyFile(source, icon_text)) {
ASSERT_TRUE(bf::exists(cache_path));
bf::path manifest_path =
- bf::path(getUserManifestPath(getuid())) / (pkgid + ".xml");
- bf::path icon_path = bf::path(getIconPath(getuid())) / (appid + ".png");
+ 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));
ASSERT_FALSE(bf::exists(package_path));
bf::path manifest_path =
- bf::path(getUserManifestPath(getuid())) / (pkgid + ".xml");
- bf::path icon_path = bf::path(getIconPath(getuid())) / (appid + ".png");
+ 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));