mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-10-07 08:23:36 +00:00
!8380 增加Attach调试 PC通信权限校验相关逻辑
Merge pull request !8380 from xinking129/master
This commit is contained in:
commit
addaf7aa1b
@ -19,6 +19,7 @@
|
||||
#include "hilog_tag_wrapper.h"
|
||||
#include "hilog_wrapper.h"
|
||||
#include "hitrace_meter.h"
|
||||
#include "in_process_call_wrapper.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AAFwk {
|
||||
@ -30,7 +31,8 @@ void AbilityDebugDeal::RegisterAbilityDebugResponse()
|
||||
return;
|
||||
}
|
||||
|
||||
DelayedSingleton<AppScheduler>::GetInstance()->RegisterAbilityDebugResponse(abilityDebugResponse_);
|
||||
IN_PROCESS_CALL_WITHOUT_RET(
|
||||
DelayedSingleton<AppScheduler>::GetInstance()->RegisterAbilityDebugResponse(abilityDebugResponse_));
|
||||
}
|
||||
|
||||
void AbilityDebugDeal::OnAbilitysDebugStarted(const std::vector<sptr<IRemoteObject>> &tokens)
|
||||
|
@ -5380,6 +5380,10 @@ void AppMgrServiceInner::ClearNonPersistWaitingDebugFlag()
|
||||
|
||||
int32_t AppMgrServiceInner::RegisterAbilityDebugResponse(const sptr<IAbilityDebugResponse> &response)
|
||||
{
|
||||
if (IPCSkeleton::GetCallingUid() != FOUNDATION_UID) {
|
||||
TAG_LOGE(AAFwkTag::APPMGR, "Not foundation call.");
|
||||
return ERR_PERMISSION_DENIED;
|
||||
}
|
||||
if (response == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::APPMGR, "Response is nullptr.");
|
||||
return ERR_INVALID_VALUE;
|
||||
@ -5429,6 +5433,11 @@ int32_t AppMgrServiceInner::NotifyAbilitysAssertDebugChange(
|
||||
bool AppMgrServiceInner::IsAttachDebug(const std::string &bundleName)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::APPMGR, "Called.");
|
||||
auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall();
|
||||
if (!isSaCall) {
|
||||
TAG_LOGE(AAFwkTag::APPMGR, "Caller token is not SA.");
|
||||
return false;
|
||||
}
|
||||
if (appRunningManager_ == nullptr || bundleName.empty()) {
|
||||
TAG_LOGE(AAFwkTag::APPMGR, "appRunningManager_ or bundleName is nullptr.");
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user