diff --git a/services/bundlemgr_lite/include/gt_bundle_manager_service.h b/services/bundlemgr_lite/include/gt_bundle_manager_service.h index ff09786..48b7afc 100755 --- a/services/bundlemgr_lite/include/gt_bundle_manager_service.h +++ b/services/bundlemgr_lite/include/gt_bundle_manager_service.h @@ -67,7 +67,6 @@ public: uint8_t GetBundleInfo(const char *bundleName, int32_t flags, BundleInfo& bundleInfo); uint8_t GetBundleInfos(const int flags, BundleInfo **bundleInfos, int32_t *len); void ScanPackages(); - void SendBundleListChangedToLauncher(BundleState state, const char *bundleName); BundleInfo *QueryBundleInfo(const char *bundleName); void RemoveBundleInfo(const char *bundleName); void AddBundleInfo(BundleInfo *info); diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index 6c655ca..a0865ff 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -38,7 +38,6 @@ namespace OHOS { const uint8_t PAIR_VALUE = 2; -const uint8_t FINISHED_PROCESS = 100; const uint8_t OPERATION_DOING = 200; const uint8_t BMS_INSTALLATION_START = 101; const uint8_t BMS_UNINSTALLATION_START = 104; @@ -175,12 +174,20 @@ bool GtManagerService::Uninstall(const char *bundleName, const InstallParam *ins bool GtManagerService::GetInstallState(const char *bundleName, InstallState *installState, uint8_t *installProcess) { + if (bundleName == nullptr) { + retrun false; + } BundleInfo *installedInfo = bundleMap_->Get(bundleName); if (installedInfo != nullptr) { *installState = BUNDLE_INSTALL_OK; *installProcess = BMS_INSTALLATION_COMPLETED; return true; } + if (bundleInstallMsg_ == nullptr) { + *installState = BUNDLE_INSTALL_FAIL; + *installProcess = 0; + return true; + } if (strcmp(bundleName, bundleInstallMsg_->bundleName) == 0) { *installState = bundleInstallMsg_->installState; *installProcess = bundleInstallMsg_->installProcess; @@ -851,21 +858,6 @@ void GtManagerService::ReduceNumOfThirdBundles() installedThirdBundleNum_--; } -void GtManagerService::SendBundleListChangedToLauncher(BundleState state, const char *bundleName) -{ - if (bundleName == nullptr) { - return; - } - char *innerBundleName = reinterpret_cast(SvrMalloc(strlen(bundleName) + 1)); - if (innerBundleName == nullptr) { - return; - } - if (strncpy_s(innerBundleName, strlen(bundleName) + 1, bundleName, strlen(bundleName)) != EOK) { - SvrFree(innerBundleName); - return; - } -} - int32_t GtManagerService::ReportInstallCallback(uint8_t errCode, uint8_t installState, uint8_t process, InstallerCallback installerCallback) {