namespace {
+const char kInstalledInternally[] = "installed_internal";
const char kInstalledExternally[] = "installed_external";
const char kInternalOnly[] = "internal-only";
const char kPreferExternal[] = "prefer-external";
context_->unpacked_dir_path.get(),
context_->uid.get());
+ // TODO(jeremy.jang): This checking should be moved to
+ // StepCheckInstallLocation
if (storage == Storage::EXTERNAL && !context_->external_storage) {
if (!installed_) {
LOG(WARNING) << "Cannot initialize external storage "
<< "for installed package";
- storage = Storage::INTERNAL;
+ context_->storage.set(Storage::INTERNAL);
+ free(manifest->installed_storage);
+ manifest->installed_storage = strdup(kInstalledInternally);
} else {
LOG(ERROR) << "Cannot initialize external storage for updated package";
- storage = Storage::INTERNAL;
+ context_->storage.set(Storage::INTERNAL);
+ free(manifest->installed_storage);
+ manifest->installed_storage = strdup(kInstalledInternally);
}
}