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

Commit 97ce58a0 authored by Aritra Sen's avatar Aritra Sen Committed by Gerrit Code Review
Browse files

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

parents ed9901cc db879f13
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) {