Use context AttributionSource as the identity source-of-truth for connection
CameraService::connect and ::connectDevice allow an argument of USE_CALLING_*
for both the pid and uid of the client. In this change, USE_CALLING_* is
retired in favor of using the AttributionSource provided by the calling
Context. The AttributionSource pid/uid is verified to be truthful via
getCallingPid() / getCallingUid().
This change has no impact on APIs which do not pass the pid/uid through
ICameraService - the AttributionSource pid/uid are ignored for those
APIs and the calling pid / uid are still universally used.
Bug: 190657833
Bug: 369850244
Change-Id: I622c24b7ace926645b64ac70650e401dc7ad5f1e
Flag: com.android.internal.camera.flags.use_context_attribution_source
Test: smoke test GCA
diff --git a/camera/camera_platform.aconfig b/camera/camera_platform.aconfig
index 8ed23fd..e34a004 100644
--- a/camera/camera_platform.aconfig
+++ b/camera/camera_platform.aconfig
@@ -215,3 +215,10 @@
description: "Enable stream reconfiguration for unchanged streams"
bug: "341740105"
}
+
+flag {
+ namespace: "camera_platform"
+ name: "use_context_attribution_source"
+ description: "Use the context-provided AttributionSource when checking for client permissions"
+ bug: "190657833"
+}