mirror of
https://github.com/openharmony/appexecfwk_standard.git
synced 2026-07-19 14:06:09 -04:00
@@ -132,6 +132,7 @@ private:
|
||||
bool ready_ = false;
|
||||
bool registerToService_ = false;
|
||||
bool needToScan_ = false;
|
||||
bool notifyBundleScanStatus = false;
|
||||
std::shared_ptr<EventRunner> runner_;
|
||||
std::shared_ptr<BMSEventHandler> handler_;
|
||||
std::shared_ptr<BundleDataMgr> dataMgr_;
|
||||
|
||||
@@ -80,6 +80,7 @@ void BundleMgrService::OnStart()
|
||||
if (!needToScan_) {
|
||||
PerfProfile::GetInstance().Dump();
|
||||
}
|
||||
AddSystemAbilityListener(COMMON_EVENT_SERVICE_ID);
|
||||
#ifdef DEVICE_MANAGER_ENABLE
|
||||
AddSystemAbilityListener(DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID);
|
||||
AddSystemAbilityListener(DISTRIBUTED_BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);
|
||||
@@ -316,29 +317,35 @@ void BundleMgrService::NotifyBundleScanStatus()
|
||||
want.SetAction(EventFwk::CommonEventSupport::COMMON_EVENT_BUNDLE_SCAN_FINISHED);
|
||||
EventFwk::CommonEventData commonEventData { want };
|
||||
if (!EventFwk::CommonEventManager::PublishCommonEvent(commonEventData)) {
|
||||
notifyBundleScanStatus = true;
|
||||
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)
|
||||
{
|
||||
APP_LOGD("OnAddSystemAbility systemAbilityId:%{public}d added!", systemAbilityId);
|
||||
#ifdef DEVICE_MANAGER_ENABLE
|
||||
if (deviceManager_) {
|
||||
deviceManager_->OnAddSystemAbility(systemAbilityId, deviceId);
|
||||
}
|
||||
#endif
|
||||
if (COMMON_EVENT_SERVICE_ID == systemAbilityId && notifyBundleScanStatus) {
|
||||
NotifyBundleScanStatus();
|
||||
}
|
||||
}
|
||||
|
||||
void BundleMgrService::OnRemoveSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
|
||||
{
|
||||
APP_LOGD("OnRemoveSystemAbility systemAbilityId:%{public}d removed!", systemAbilityId);
|
||||
#ifdef DEVICE_MANAGER_ENABLE
|
||||
if (deviceManager_) {
|
||||
deviceManager_->OnRemoveSystemAbility(systemAbilityId, deviceId);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BundleMgrService::Hidump(const std::vector<std::string> &args, std::string& result) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user