#include <boost/tokenizer.hpp>
+#include <app2ext_interface.h>
#include <pkgmgr/pkgmgr_parser.h>
#include <pkgmgr-info.h>
const char kManifestFileName[] = "tizen-manifest.xml";
const char kInstalledInternally[] = "installed_internal";
+const char kInstalledExternally[] = "installed_external";
const char kPortraitOrientation[] = "portrait";
const char kLandscapeOrientation[] = "landscape";
const char kOperationEffectKey[] = "operation_effect";
manifest->type = strdup(pkg_info->type().c_str());
}
+ // Set external path if the package is installed at external storage.
+ if (req_type == RequestType::ManifestDirectInstall ||
+ req_type == RequestType::ManifestDirectUpdate ||
+ req_type == RequestType::ManifestPartialInstall ||
+ req_type == RequestType::ManifestPartialUpdate) {
+ char* image_path = app2ext_usr_get_image_path(context_->pkgid.get().c_str(),
+ context_->uid.get());
+ if (image_path) {
+ manifest->external_path = image_path;
+ manifest->installed_storage = strdup(kInstalledExternally);
+ }
+ }
+
for (auto& pair : pkg_info->labels()) {
label_x* label = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
if (!label) {
// set installed_storage if package is installed
// this is internal field in package manager but after reading configuration
// we must know it
- if (manifest_location_ == ManifestLocation::INSTALLED ||
- manifest_location_ == ManifestLocation::RECOVERY) {
- std::string storage = QueryStorageForPkgId(manifest->package,
- context_->uid.get());
- if (storage.empty()) {
+ if (!manifest->installed_storage) {
+ if (manifest_location_ == ManifestLocation::INSTALLED ||
+ manifest_location_ == ManifestLocation::RECOVERY) {
+ std::string storage = QueryStorageForPkgId(manifest->package,
+ context_->uid.get());
+ if (storage.empty()) {
// Failed to query installation storage, assign internal
manifest->installed_storage = strdup(kInstalledInternally);
- } else {
+ } else {
manifest->installed_storage = strdup(storage.c_str());
+ }
+ } else {
+ manifest->installed_storage = strdup(kInstalledInternally);
}
- } else {
- manifest->installed_storage = strdup(kInstalledInternally);
}
return true;