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

Commit 11d3f168 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12025384 from 6047ff27 to 24Q4-release

Change-Id: I20d95bbe3dcdb036b054ace1062ecf683b69a30a
parents f7395f4a 6047ff27
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1378,18 +1378,19 @@ public class A2dpService extends ProfileService {

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private A2dpService getService(AttributionSource source) {
            // Cache mService because it can change while getService is called
            A2dpService service = mService;

            if (Utils.isInstrumentationTestMode()) {
                return mService;
                return service;
            }
            A2dpService currService = mService;

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

        BluetoothA2dpBinder(A2dpService svc) {
+18 −13
Original line number Diff line number Diff line
@@ -195,19 +195,6 @@ public class A2dpSinkService extends ProfileService {
            implements IProfileServiceBinder {
        private A2dpSinkService mService;

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private A2dpSinkService getService(AttributionSource source) {
            if (Utils.isInstrumentationTestMode()) {
                return mService;
            }
            if (!Utils.checkServiceAvailable(mService, TAG)
                    || !Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG)
                    || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) {
                return null;
            }
            return mService;
        }

        A2dpSinkServiceBinder(A2dpSinkService svc) {
            mService = svc;
        }
@@ -217,6 +204,24 @@ public class A2dpSinkService extends ProfileService {
            mService = null;
        }

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private A2dpSinkService getService(AttributionSource source) {
            // Cache mService because it can change while getService is called
            A2dpSinkService service = mService;

            if (Utils.isInstrumentationTestMode()) {
                return service;
            }

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

            return service;
        }

        @Override
        public boolean connect(BluetoothDevice device, AttributionSource source) {
            A2dpSinkService service = getService(source);
+18 −13
Original line number Diff line number Diff line
@@ -371,19 +371,6 @@ public class AvrcpControllerService extends ProfileService {
            implements IProfileServiceBinder {
        private AvrcpControllerService mService;

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private AvrcpControllerService getService(AttributionSource source) {
            if (Utils.isInstrumentationTestMode()) {
                return mService;
            }
            if (!Utils.checkServiceAvailable(mService, TAG)
                    || !Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG)
                    || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) {
                return null;
            }
            return mService;
        }

        AvrcpControllerServiceBinder(AvrcpControllerService service) {
            mService = service;
        }
@@ -393,6 +380,24 @@ public class AvrcpControllerService extends ProfileService {
            mService = null;
        }

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private AvrcpControllerService getService(AttributionSource source) {
            // Cache mService because it can change while getService is called
            AvrcpControllerService service = mService;

            if (Utils.isInstrumentationTestMode()) {
                return service;
            }

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

            return service;
        }

        @Override
        public List<BluetoothDevice> getConnectedDevices(AttributionSource source) {
            AvrcpControllerService service = getService(source);
+7 −7
Original line number Diff line number Diff line
@@ -1958,13 +1958,13 @@ public class BassClientService extends ProfileService {
                log("No PA record found");
                return;
            }
            if (!result.isNotified()) {
                result.setNotified(true);
            BaseData baseData = getBase(syncHandle);
            if (baseData == null) {
                log("No BaseData found");
                return;
            }
            if (!result.isNotified()) {
                result.setNotified(true);
                BluetoothLeBroadcastMetadata metaData =
                        getBroadcastMetadataFromBaseData(
                                baseData, srcDevice, syncHandle, encrypted);
@@ -2263,8 +2263,8 @@ public class BassClientService extends ProfileService {
            }
        }

        if (broadcastId == BassConstants.INVALID_BROADCAST_ID || pbData == null) {
            Log.w(TAG, "Invalid broadcast ID or public broadcast data");
        if (broadcastId == BassConstants.INVALID_BROADCAST_ID) {
            Log.w(TAG, "Invalid broadcast ID");
            mPeriodicAdvCallbacksMap.remove(BassConstants.INVALID_SYNC_HANDLE);
            handleSelectSourceRequest();
            return;
+2 −2
Original line number Diff line number Diff line
@@ -461,8 +461,8 @@ public class BassClientStateMachine extends StateMachine {
                }
            }

            if (broadcastId == BassConstants.INVALID_BROADCAST_ID || pbData == null) {
                Log.w(TAG, "Invalid broadcast ID or public broadcast data");
            if (broadcastId == BassConstants.INVALID_BROADCAST_ID) {
                Log.w(TAG, "Invalid broadcast ID");
                return false;
            }

Loading