Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad904a8c authored by Austin Borger's avatar Austin Borger
Browse files

Create a token for the AttributionSource ACameraManager passes to connectDevice

If an AttributionSource does not have a token, data delivery permission checks
fail with "Attempt to invoke interface method
'void android.os.IBinder.linkToDeath(android.os.IBinder$DeathRecipient, int)'
on a null object reference" due to the null binder. Create a token before
passing it to connectDevice.

Bug: 190657833
Flag: com.android.internal.camera.flags.data_delivery_permission_checks
Test: Ran new CameraPermissionTest for ndk clients.
Change-Id: Id7f173ae155b26c723c39cccc8fcbbdc482479a3
parent f2da9c7c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -920,6 +920,7 @@ ACameraManager::openCamera(
    clientAttribution.deviceId = mDeviceContext.deviceId;
    clientAttribution.packageName = "";
    clientAttribution.attributionTag = std::nullopt;
    clientAttribution.token = sp<BBinder>::make();

    // No way to get package name from native.
    // Send a zero length package name and let camera service figure it out from UID