From 26e781a054aee123a102e4899af6616080c8838e Mon Sep 17 00:00:00 2001 From: z30025928 <734222381@qq.com> Date: Thu, 27 Jun 2024 14:25:00 +0800 Subject: [PATCH] adapter for car parking Signed-off-by: z30025928 <734222381@qq.com> --- services/etc/init/locationsa.cfg | 2 ++ .../location_locator/locator/source/locator_skeleton.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/services/etc/init/locationsa.cfg b/services/etc/init/locationsa.cfg index 4c797537..22fc00de 100644 --- a/services/etc/init/locationsa.cfg +++ b/services/etc/init/locationsa.cfg @@ -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", diff --git a/services/location_locator/locator/source/locator_skeleton.cpp b/services/location_locator/locator/source/locator_skeleton.cpp index 1672cd1c..1f51c95f 100644 --- a/services/location_locator/locator/source/locator_skeleton.cpp +++ b/services/location_locator/locator/source/locator_skeleton.cpp @@ -1186,6 +1186,11 @@ int32_t LocatorAbilityStub::OnRemoteRequest(uint32_t code, 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(getuid()) + && callingPid == getpid()) { + callingFirstTokenid = 0; + } AppIdentity identity; identity.SetPid(callingPid);