mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 15:20:34 +00:00
commit
1e6440c012
@ -955,6 +955,7 @@ void ContextImpl::SubscribeToOverlayEvents(std::shared_ptr<Global::Resource::Res
|
|||||||
const std::string &name, const std::string &hapModuleName, std::string &loadPath,
|
const std::string &name, const std::string &hapModuleName, std::string &loadPath,
|
||||||
std::vector<AppExecFwk::OverlayModuleInfo> overlayModuleInfos)
|
std::vector<AppExecFwk::OverlayModuleInfo> overlayModuleInfos)
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(overlaySubscriberMutex_);
|
||||||
if (overlaySubscriber_ != nullptr) {
|
if (overlaySubscriber_ != nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -976,6 +977,7 @@ void ContextImpl::SubscribeToOverlayEvents(std::shared_ptr<Global::Resource::Res
|
|||||||
|
|
||||||
void ContextImpl::UnsubscribeToOverlayEvents()
|
void ContextImpl::UnsubscribeToOverlayEvents()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(overlaySubscriberMutex_);
|
||||||
if (overlaySubscriber_ != nullptr) {
|
if (overlaySubscriber_ != nullptr) {
|
||||||
EventFwk::CommonEventManager::UnSubscribeCommonEvent(overlaySubscriber_);
|
EventFwk::CommonEventManager::UnSubscribeCommonEvent(overlaySubscriber_);
|
||||||
overlaySubscriber_ = nullptr;
|
overlaySubscriber_ = nullptr;
|
||||||
|
@ -495,6 +495,7 @@ private:
|
|||||||
// False: no need to get a new fms remote object.
|
// False: no need to get a new fms remote object.
|
||||||
volatile bool resetFlag_ = false;
|
volatile bool resetFlag_ = false;
|
||||||
|
|
||||||
|
std::mutex overlaySubscriberMutex_;
|
||||||
std::shared_ptr<AppExecFwk::OverlayEventSubscriber> overlaySubscriber_;
|
std::shared_ptr<AppExecFwk::OverlayEventSubscriber> overlaySubscriber_;
|
||||||
};
|
};
|
||||||
} // namespace AbilityRuntime
|
} // namespace AbilityRuntime
|
||||||
|
@ -8120,6 +8120,10 @@ bool AppMgrServiceInner::IsProcessContainsOnlyUIAbility(const pid_t pid)
|
|||||||
void AppMgrServiceInner::MakeIsolateSandBoxProcessName(const std::shared_ptr<AbilityInfo> &abilityInfo,
|
void AppMgrServiceInner::MakeIsolateSandBoxProcessName(const std::shared_ptr<AbilityInfo> &abilityInfo,
|
||||||
const HapModuleInfo &hapModuleInfo, std::string &processName) const
|
const HapModuleInfo &hapModuleInfo, std::string &processName) const
|
||||||
{
|
{
|
||||||
|
if (abilityInfo == nullptr) {
|
||||||
|
TAG_LOGE(AAFwkTag::APPMGR, "abilityInfo nullptr");
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto type = abilityInfo->type;
|
auto type = abilityInfo->type;
|
||||||
auto extensionType = abilityInfo->extensionAbilityType;
|
auto extensionType = abilityInfo->extensionAbilityType;
|
||||||
if (type != AppExecFwk::AbilityType::EXTENSION ||
|
if (type != AppExecFwk::AbilityType::EXTENSION ||
|
||||||
@ -8127,9 +8131,12 @@ void AppMgrServiceInner::MakeIsolateSandBoxProcessName(const std::shared_ptr<Abi
|
|||||||
extensionType == AppExecFwk::ExtensionAbilityType::SERVICE) {
|
extensionType == AppExecFwk::ExtensionAbilityType::SERVICE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (auto extensionInfo: hapModuleInfo.extensionInfos) {
|
for (const auto& extensionInfo: hapModuleInfo.extensionInfos) {
|
||||||
if (extensionInfo.name == abilityInfo->name && extensionInfo.needCreateSandbox) {
|
if (extensionInfo.name == abilityInfo->name) {
|
||||||
processName = (processName + ":" + abilityInfo->name);
|
if (extensionInfo.needCreateSandbox) {
|
||||||
|
processName = (processName + ":" + abilityInfo->name);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user