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

Commit 12655df9 authored by Aritra Sen's avatar Aritra Sen Committed by Automerger Merge Worker
Browse files

Merge "Cache the current A2dpService and null check for the same to avoid...

Merge "Cache the current A2dpService and null check for the same to avoid crashes." into main am: 97ce58a0

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2983763



Change-Id: I27920a50325349e981981bf6cd99e417771954ed
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6c534bf3 97ce58a0
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1367,12 +1367,15 @@ public class A2dpService extends ProfileService {
            if (Utils.isInstrumentationTestMode()) {
                return mService;
            }
            if (!Utils.checkServiceAvailable(mService, TAG)
                    || !Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG)
                    || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) {
            A2dpService currService = mService;

            if (currService == null
                    || !Utils.checkServiceAvailable(currService, TAG)
                    || !Utils.checkCallerIsSystemOrActiveOrManagedUser(currService, TAG)
                    || !Utils.checkConnectPermissionForDataDelivery(currService, source, TAG)) {
                return null;
            }
            return mService;
            return currService;
        }

        BluetoothA2dpBinder(A2dpService svc) {