mirror of
https://github.com/openharmony/bundlemanager_bundle_framework_lite.git
synced 2026-08-27 21:30:17 -04:00
update services/bundlemgr_lite/src/gt_bundle_installer.cpp.
Signed-off-by: shilei91 <shilei91@huawei.com>
This commit is contained in:
@@ -586,11 +586,11 @@ uint8_t GtBundleInstaller::Uninstall(const char *bundleName)
|
||||
if (sprintf_s(bundleJsonPath, PATH_LENGTH, "%s%s%s", JSON_PATH, bundleName, JSON_SUFFIX) < 0) {
|
||||
return ERR_APPEXECFWK_UNINSTALL_FAILED_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
#ifndef __LITEOS_M__
|
||||
if (DeletePermissions(const_cast<char *>(bundleName)) < 0) {
|
||||
return ERR_APPEXECFWK_UNINSTALL_FAILED_DELETE_PERMISSIONS_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
bool res = CheckIsThirdSystemBundle(bundleName);
|
||||
if (!(BundleUtil::RemoveDir(bundleInfo->codePath) && BundleUtil::RemoveDir(bundleInfo->dataPath))) {
|
||||
GtManagerService::GetInstance().RemoveBundleInfo(bundleName);
|
||||
@@ -743,10 +743,12 @@ uint8_t GtBundleInstaller::StorePermissions(const char *bundleName, PermissionTr
|
||||
bool isUpdate)
|
||||
{
|
||||
if (permNum == 0) {
|
||||
#ifndef __LITEOS_M__
|
||||
if (isUpdate) {
|
||||
int32_t ret = DeletePermissions(bundleName);
|
||||
HILOG_INFO(HILOG_MODULE_AAFWK, "[BMS] delete permissions, result is %d", ret);
|
||||
}
|
||||
#endif
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
@@ -757,11 +759,12 @@ uint8_t GtBundleInstaller::StorePermissions(const char *bundleName, PermissionTr
|
||||
if (!BundleUtil::IsDir(PERMISSIONS_PATH)) {
|
||||
BundleUtil::MkDirs(PERMISSIONS_PATH);
|
||||
}
|
||||
|
||||
#ifndef __LITEOS_M__
|
||||
if (SaveOrUpdatePermissions(const_cast<char *>(bundleName), permissions, permNum,
|
||||
static_cast<IsUpdate>(isUpdate)) != 0) {
|
||||
return ERR_APPEXECFWK_INSTALL_FAILED_STORE_PERMISSIONS_ERROR;
|
||||
}
|
||||
#endif
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user