diff --git a/frameworks/native/source/system_ability_manager_proxy.cpp b/frameworks/native/source/system_ability_manager_proxy.cpp index 78a8c4f133d2d6cc96f3a37b0702cdd9970b915c..f4e5fb0322b5e9108da5f9f8aa0680334762a812 100755 --- a/frameworks/native/source/system_ability_manager_proxy.cpp +++ b/frameworks/native/source/system_ability_manager_proxy.cpp @@ -102,6 +102,9 @@ sptr SystemAbilityManagerProxy::CheckSystemAbility(int32_t system return nullptr; } MessageParcel data; + if (!data.WriteInterfaceToken(SAMANAGER_INTERFACE_TOKEN)) { + return nullptr; + } bool ret = data.WriteInt32(systemAbilityId); if (!ret) { HILOGW("CheckSystemAbility Write systemAbilityId failed!"); diff --git a/services/samgr/native/source/system_ability_manager_stub.cpp b/services/samgr/native/source/system_ability_manager_stub.cpp old mode 100644 new mode 100755 index 62892d1beeacf7bd49bfe28ad3da5c5a3ba84628..18260a8a8bb9ca5a35731c9033632a846d9e3979 --- a/services/samgr/native/source/system_ability_manager_stub.cpp +++ b/services/samgr/native/source/system_ability_manager_stub.cpp @@ -59,11 +59,9 @@ int32_t SystemAbilityManagerStub::OnRemoteRequest(uint32_t code, { HILOGI("SystemAbilityManagerStub::OnReceived, code = %{public}d, flags= %{public}d", code, option.GetFlags()); - if (code != GET_SYSTEM_ABILITY_TRANSACTION && code != CHECK_SYSTEM_ABILITY_TRANSACTION) { - if (!EnforceInterceToken(data)) { - HILOGI("SystemAbilityManagerStub::OnReceived, code = %{public}d, check interfaceToken failed", code); - return ERR_PERMISSION_DENIED; - } + if (!EnforceInterceToken(data)) { + HILOGI("SystemAbilityManagerStub::OnReceived, code = %{public}d, check interfaceToken failed", code); + return ERR_PERMISSION_DENIED; } auto itFunc = memberFuncMap_.find(code); if (itFunc != memberFuncMap_.end()) {