!734 adapter for car parking

Merge pull request !734 from smilebear/master
This commit is contained in:
openharmony_ci 2024-07-29 11:06:46 +00:00 committed by Gitee
commit 1c5896687c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,8 @@
"ohos.permission.MANAGE_SECURE_SETTINGS",
"ohos.permission.GET_TELEPHONY_STATE",
"ohos.permission.LOCATION",
"ohos.permission.APPROXIMATELY_LOCATION",
"ohos.permission.LOCATION_IN_BACKGROUND",
"ohos.permission.GET_WIFI_INFO",
"ohos.permission.SET_WIFI_INFO",
"ohos.permission.GET_RUNNING_INFO",

View File

@ -1337,6 +1337,17 @@ int32_t LocatorAbilityStub::OnRemoteRequest(uint32_t code,
MessageParcel &data, MessageParcel &reply, MessageOption &option)
{
int ret = ERRCODE_SUCCESS;
pid_t callingPid = IPCSkeleton::GetCallingPid();
pid_t callingUid = IPCSkeleton::GetCallingUid();
uint32_t callingTokenId = IPCSkeleton::GetCallingTokenID();
uint64_t callingTokenIdEx = IPCSkeleton::GetCallingFullTokenID();
uint32_t callingFirstTokenid = IPCSkeleton::GetFirstTokenID();
// first token id is invalid
if (callingUid == callingFirstTokenid && callingUid == static_cast<pid_t>(getuid())
&& callingPid == getpid()) {
callingFirstTokenid = 0;
}
AppIdentity identity;
identity.SetPid(IPCSkeleton::GetCallingPid());
identity.SetUid(IPCSkeleton::GetCallingUid());