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

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

Create a token for the AttributionSource CameraSource passes to connect

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 connect.

Bug: 190657833
Flag: com.android.internal.camera.flags.data_delivery_permission_checks
Test: Ran CtsCameraTestCases
Change-Id: I83c760c8a81976d899b75942eb5177baaa590a16
parent 9aab1380
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ status_t CameraSource::isCameraAvailable(
        clientAttribution.uid = clientUid;
        clientAttribution.deviceId = kDefaultDeviceId;
        clientAttribution.packageName = clientName;
        clientAttribution.token = sp<BBinder>::make();

        mCamera = Camera::connect(cameraId, /*targetSdkVersion*/__ANDROID_API_FUTURE__,
                /*rotationOverride*/hardware::ICameraService::ROTATION_OVERRIDE_NONE,