diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 742d682aef5dd555e9a736030a02c467a2291bba..27a7cf5c7c598837dbb2a4939b25958e3894639f 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -3558,21 +3558,20 @@ int AbilityManagerService::ReleaseAbility( int AbilityManagerService::CheckCallPermissions(const AbilityRequest &abilityRequest) { HILOG_DEBUG("%{public}s begin", __func__); - auto abilityInfo = abilityRequest.abilityInfo; auto callerUid = abilityRequest.callerUid; auto targetUid = abilityInfo.applicationInfo.uid; - if (AbilityUtil::ROOT_UID == callerUid) { HILOG_DEBUG("uid is root,ability cannot be called."); return RESOLVE_CALL_NO_PERMISSIONS; } - auto bms = GetBundleManager(); CHECK_POINTER_AND_RETURN(bms, GET_ABILITY_SERVICE_FAILED); - - auto isSystemApp = bms->CheckIsSystemAppByUid(callerUid); - if (callerUid != SYSTEM_UID && !isSystemApp) { + auto isCallerSystemApp = bms->CheckIsSystemAppByUid(callerUid); + auto isTargetSystemApp = bms->CheckIsSystemAppByUid(targetUid); + HILOG_ERROR("isCallerSystemApp:%{public}d, isTargetSystemApp:%{public}d", + isCallerSystemApp, isTargetSystemApp); + if (callerUid != SYSTEM_UID && !isCallerSystemApp) { HILOG_DEBUG("caller is common app."); std::string bundleName; bool result = bms->GetBundleNameForUid(callerUid, bundleName); @@ -3580,7 +3579,7 @@ int AbilityManagerService::CheckCallPermissions(const AbilityRequest &abilityReq HILOG_ERROR("GetBundleNameForUid frome bms fail."); return RESOLVE_CALL_NO_PERMISSIONS; } - if (bundleName != abilityInfo.bundleName && callerUid != targetUid) { + if (bundleName != abilityInfo.bundleName && callerUid != targetUid && !isTargetSystemApp) { HILOG_ERROR("the bundlename of caller is different from target one, caller: %{public}s " "target: %{public}s", bundleName.c_str(), @@ -3590,9 +3589,7 @@ int AbilityManagerService::CheckCallPermissions(const AbilityRequest &abilityReq } else { HILOG_DEBUG("caller is systemapp or system ability."); } - HILOG_DEBUG("the caller has permission to resolve the callproxy of common ability."); - // check whether the target ability is singleton mode and page type. if (abilityInfo.type == AppExecFwk::AbilityType::PAGE && abilityInfo.launchMode == AppExecFwk::LaunchMode::SINGLETON) { @@ -3601,7 +3598,6 @@ int AbilityManagerService::CheckCallPermissions(const AbilityRequest &abilityReq HILOG_ERROR("called ability is not common ability or singleton."); return RESOLVE_CALL_ABILITY_TYPE_ERR; } - return ERR_OK; } @@ -3662,7 +3658,11 @@ void AbilityManagerService::OnAcceptWantResponse( void AbilityManagerService::OnStartSpecifiedAbilityTimeoutResponse(const AAFwk::Want &want) { - return; + HILOG_DEBUG("%{public}s called.", __func__); + if (!currentMissionListManager_) { + return; + } + currentMissionListManager_->OnStartSpecifiedAbilityTimeoutResponse(want); } int AbilityManagerService::GetAbilityRunningInfos(std::vector &info)