mirror of
https://github.com/openharmony/appexecfwk_standard.git
synced 2026-07-19 22:14:29 -04:00
@@ -94,6 +94,10 @@ public:
|
||||
* @brief register bms sa to samgr
|
||||
*/
|
||||
void RegisterService();
|
||||
/**
|
||||
* @brief send bundle scan finished common event
|
||||
*/
|
||||
void NotifyBundleScanStatus();
|
||||
/**
|
||||
* @brief Process hidump.
|
||||
* @param args Indicates the args.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "bundle_mgr_service.h"
|
||||
|
||||
#include "ohos/aafwk/content/want.h"
|
||||
|
||||
#include "account_helper.h"
|
||||
#include "app_log_wrapper.h"
|
||||
#include "bundle_constants.h"
|
||||
@@ -317,6 +319,19 @@ void BundleMgrService::RegisterService()
|
||||
AfterRegisterToService();
|
||||
}
|
||||
|
||||
void BundleMgrService::NotifyBundleScanStatus()
|
||||
{
|
||||
APP_LOGD("PublishCommonEvent for bundle scan finished");
|
||||
AAFwk::Want want;
|
||||
want.SetAction(EventFwk::CommonEventSupport::COMMON_EVENT_BUNDLE_SCAN_FINISHED);
|
||||
EventFwk::CommonEventData commonEventData { want };
|
||||
if (!EventFwk::CommonEventManager::PublishCommonEvent(commonEventData)) {
|
||||
APP_LOGE("PublishCommonEvent for bundle scan finished failed.");
|
||||
} else {
|
||||
APP_LOGD("PublishCommonEvent for bundle scan finished succeed.");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEVICE_MANAGER_ENABLE
|
||||
void BundleMgrService::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
|
||||
{
|
||||
|
||||
@@ -71,6 +71,7 @@ void BMSEventHandler::ProcessEvent(const InnerEvent::Pointer &event)
|
||||
OnRebootStartScanning();
|
||||
SetAllInstallFlag();
|
||||
DelayedSingleton<BundleMgrService>::GetInstance()->RegisterService();
|
||||
DelayedSingleton<BundleMgrService>::GetInstance()->NotifyBundleScanStatus();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -100,6 +100,9 @@ void BundleUserMgrHostImpl::CreateNewUser(int32_t userId)
|
||||
if (static_cast<int32_t>(g_installedHapNum) < totalHapNum) {
|
||||
bundlePromise->WaitForAllTasksExecute();
|
||||
}
|
||||
if (userId == Constants::START_USERID) {
|
||||
DelayedSingleton<BundleMgrService>::GetInstance()->NotifyBundleScanStatus();
|
||||
}
|
||||
APP_LOGD("CreateNewUser end userId: (%{public}d)", userId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user