Loading services/camera/libcameraservice/CameraService.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -2254,9 +2254,12 @@ Status CameraService::connectDevice( int callingPid = getCallingPid(); int callingUid = getCallingUid(); bool systemNativeClient = false; AttributionSourceState resolvedClientAttribution(clientAttribution); if (callerHasSystemUid() && (clientPackageNameMaybe.size() == 0)) { std::string systemClient = fmt::sprintf("client.pid<%d>", callingPid); clientPackageNameMaybe = systemClient; // Pass in packageName since AttributionAndPermissionUtils can't resolve vndk clients. resolvedClientAttribution.packageName = clientPackageNameMaybe; systemNativeClient = true; } Loading @@ -2272,10 +2275,10 @@ Status CameraService::connectDevice( bool isNonSystemNdk = clientPackageNameMaybe.size() == 0; AttributionSourceState resolvedClientAttribution(clientAttribution); if (!flags::use_context_attribution_source()) { resolvedClientAttribution.pid = USE_CALLING_PID; } ret = resolveAttributionSource(resolvedClientAttribution, __FUNCTION__, cameraId); if (!ret.isOk()) { logRejected(cameraId, getCallingPid(), clientAttribution.packageName.value_or(""), Loading services/camera/libcameraservice/utils/AttributionAndPermissionUtils.h +14 −2 Original line number Diff line number Diff line Loading @@ -263,8 +263,20 @@ class AttributionAndPermissionUtilsEncapsulator { binder::Status resolveAttributionSource(AttributionSourceState& resolvedAttributionSource, const std::string& methodName, const std::optional<std::string>& cameraIdMaybe) { return mAttributionAndPermissionUtils->resolveAttributionSource(resolvedAttributionSource, methodName, cameraIdMaybe); std::string passedPackageName; if (resolvedAttributionSource.packageName.has_value()) { passedPackageName = resolvedAttributionSource.packageName.value(); } auto ret = mAttributionAndPermissionUtils->resolveAttributionSource( resolvedAttributionSource, methodName, cameraIdMaybe); if (!ret.isOk()) { return ret; } // Fix up package name if (passedPackageName.size() != 0) { resolvedAttributionSource.packageName = std::move(passedPackageName); } return ret; } // The word 'System' here does not refer to callers only on the system Loading Loading
services/camera/libcameraservice/CameraService.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -2254,9 +2254,12 @@ Status CameraService::connectDevice( int callingPid = getCallingPid(); int callingUid = getCallingUid(); bool systemNativeClient = false; AttributionSourceState resolvedClientAttribution(clientAttribution); if (callerHasSystemUid() && (clientPackageNameMaybe.size() == 0)) { std::string systemClient = fmt::sprintf("client.pid<%d>", callingPid); clientPackageNameMaybe = systemClient; // Pass in packageName since AttributionAndPermissionUtils can't resolve vndk clients. resolvedClientAttribution.packageName = clientPackageNameMaybe; systemNativeClient = true; } Loading @@ -2272,10 +2275,10 @@ Status CameraService::connectDevice( bool isNonSystemNdk = clientPackageNameMaybe.size() == 0; AttributionSourceState resolvedClientAttribution(clientAttribution); if (!flags::use_context_attribution_source()) { resolvedClientAttribution.pid = USE_CALLING_PID; } ret = resolveAttributionSource(resolvedClientAttribution, __FUNCTION__, cameraId); if (!ret.isOk()) { logRejected(cameraId, getCallingPid(), clientAttribution.packageName.value_or(""), Loading
services/camera/libcameraservice/utils/AttributionAndPermissionUtils.h +14 −2 Original line number Diff line number Diff line Loading @@ -263,8 +263,20 @@ class AttributionAndPermissionUtilsEncapsulator { binder::Status resolveAttributionSource(AttributionSourceState& resolvedAttributionSource, const std::string& methodName, const std::optional<std::string>& cameraIdMaybe) { return mAttributionAndPermissionUtils->resolveAttributionSource(resolvedAttributionSource, methodName, cameraIdMaybe); std::string passedPackageName; if (resolvedAttributionSource.packageName.has_value()) { passedPackageName = resolvedAttributionSource.packageName.value(); } auto ret = mAttributionAndPermissionUtils->resolveAttributionSource( resolvedAttributionSource, methodName, cameraIdMaybe); if (!ret.isOk()) { return ret; } // Fix up package name if (passedPackageName.size() != 0) { resolvedAttributionSource.packageName = std::move(passedPackageName); } return ret; } // The word 'System' here does not refer to callers only on the system Loading