From e5e6bfb2452964ec3cd1886414ad81cce3830393 Mon Sep 17 00:00:00 2001 From: linxiangzhi Date: Fri, 22 Jul 2022 11:03:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: linxiangzhi Change-Id: I48004032c4d0cac92822ea1bbfefd9d8a09a4c22 --- .../include/gt_bundle_manager_service.h | 1 + .../src/gt_bundle_manager_service.cpp | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/services/bundlemgr_lite/include/gt_bundle_manager_service.h b/services/bundlemgr_lite/include/gt_bundle_manager_service.h index 3a93712..5aba5f3 100755 --- a/services/bundlemgr_lite/include/gt_bundle_manager_service.h +++ b/services/bundlemgr_lite/include/gt_bundle_manager_service.h @@ -56,6 +56,7 @@ public: static GtManagerService instance; return instance; } + bool InstallOperation(const char *hapPath, InstallerCallback installerCallback); bool Install(const char *hapPath, const InstallParam *installParam, InstallerCallback installerCallback); bool Uninstall(const char *bundleName, const InstallParam *installParam, InstallerCallback installerCallback); uint8_t QueryAbilityInfo(const Want *want, AbilityInfo *abilityInfo); diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index d5bb5fc..f2cff33 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -65,13 +65,8 @@ GtManagerService::~GtManagerService() bundleResList_ = nullptr; } -bool GtManagerService::Install(const char *hapPath, const InstallParam *installParam, - InstallerCallback installerCallback) +bool GtManagerService::InstallOperation(const char *hapPath, InstallerCallback installerCallback) { - HILOG_INFO(HILOG_MODULE_AAFWK, "[BMS] install start"); - if (installer_ == nullptr) { - installer_ = new GtBundleInstaller(); - } if (hapPath == nullptr) { return false; } @@ -88,8 +83,20 @@ bool GtManagerService::Install(const char *hapPath, const InstallParam *installP AdapterFree(path); return false; } +} -#ifndef __LITEOS_M__ +bool GtManagerService::Install(const char *hapPath, const InstallParam *installParam, + InstallerCallback installerCallback) +{ + HILOG_INFO(HILOG_MODULE_AAFWK, "[BMS] install start"); + if (installer_ == nullptr) { + installer_ = new GtBundleInstaller(); + } + if (!InstallOperation(hapPath, installerCallback)) { + return false; + } + + #ifndef __LITEOS_M__ // delete resource temp dir first (void) BundleUtil::RemoveDir(TMP_RESOURCE_DIR); // create new bundleInstallMsg -- Gitee