return Status::ERROR;
}
PkgQueryInterface pkg_query(context_->pkgid.get(), context_->uid.get());
- if (pkg_query.IsUpdatedPackage())
- SetExtraAttributes(true);
+ if (pkg_query.IsPreloadPackage())
+ SetExtAttrForPreloadPackage(pkg_query.IsUpdatedPackage(),
+ pkg_query.IsRemovablePackage());
UnregisterApplication();
if (!RegisterApplication()) {
LOG(ERROR) << "Unsuccessful app registration";
LOG(ERROR) << "Some parameters are lacking";
return Status::ERROR;
}
- SetExtraAttributes(false);
+ SetExtAttrForPreloadPackage(false, false);
UnregisterApplication();
if (!RegisterApplication()) {
LOG(ERROR) << "Unsuccessful app registration";
return true;
}
-void StepRecoverApplication::SetExtraAttributes(bool is_updated) {
+void StepRecoverApplication::SetExtAttrForPreloadPackage(
+ bool is_updated, bool is_removable) {
manifest_x* manifest_data = context_->manifest_data.get();
- free(manifest_data->system);
- manifest_data->system = strdup("true");
free(manifest_data->preload);
manifest_data->preload = strdup("true");
free(manifest_data->update);
manifest_data->update = strdup(is_updated ? "true" : "false");
+ free(manifest_data->system);
+ manifest_data->system = strdup(is_removable ? "false" : "true");
free(manifest_data->readonly);
- manifest_data->readonly = strdup(is_updated ? "false" : "true");
+ manifest_data->readonly = strdup(is_removable ? "false" : "true");
free(manifest_data->removable);
- manifest_data->removable = strdup(is_updated ? "true" : "false");
+ manifest_data->removable = strdup(is_removable ? "true" : "false");
}
bool StepRecoverApplication::UnregisterApplication() {