Signed-off-by: sodanotgreen <limengzheng@huawei.com>
This commit is contained in:
sodanotgreen 2024-08-05 21:11:34 +08:00
parent 68c7b615bd
commit 7d976021f6
2 changed files with 4 additions and 0 deletions

View File

@ -411,11 +411,13 @@ void UIAbility::OnRestoreAbilityState(const AppExecFwk::PacMap &inState)
void UIAbility::SetWant(const AAFwk::Want &want)
{
std::lock_guard<std::mutex> lock(wantMutexlock_);
setWant_ = std::make_shared<AAFwk::Want>(want);
}
std::shared_ptr<AAFwk::Want> UIAbility::GetWant()
{
std::lock_guard<std::mutex> lock(wantMutexlock_);
return setWant_;
}
@ -551,6 +553,7 @@ sptr<IRemoteObject> UIAbility::CallRequest()
bool UIAbility::IsUseNewStartUpRule()
{
std::lock_guard<std::mutex> lock(wantMutexlock_);
if (!isNewRuleFlagSetted_ && setWant_) {
startUpNewRule_ = setWant_->GetBoolParam(COMPONENT_STARTUP_NEW_RULES, false);
isNewRuleFlagSetted_ = true;

View File

@ -610,6 +610,7 @@ private:
std::string identityToken_;
bool showOnLockScreen_ = false;
std::mutex wantMutexlock_;
#endif
};
} // namespace AbilityRuntime