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

Commit 53583358 authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by android-build-merger
Browse files

Make PBAP PCE (Client) role auto-connectable.

am: 3c75851b

* commit '3c75851b':
  Make PBAP PCE (Client) role auto-connectable.

Change-Id: I759a1d25b65ee4f9dfe73e3c839d64e60a0ce206
parents 42b761d1 3c75851b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ public class AdapterService extends Service {
        A2dpSinkService a2dpSinkService = A2dpSinkService.getA2dpSinkService();
        HeadsetService headsetService = HeadsetService.getHeadsetService();
        HeadsetClientService headsetClientService = HeadsetClientService.getHeadsetClientService();
        PbapClientService pbapClientService = PbapClientService.getPbapClientService();

        // Set profile priorities only for the profiles discovered on the remote device.
        // This avoids needless auto-connect attempts to profiles non-existent on the remote device
@@ -299,6 +300,11 @@ public class AdapterService extends Service {
            a2dpSinkService.setPriority(device, BluetoothProfile.PRIORITY_ON);
        }

        if ((pbapClientService != null) &&
            (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.PBAP_PSE) &&
             (pbapClientService.getPriority(device) == BluetoothProfile.PRIORITY_UNDEFINED))) {
            pbapClientService.setPriority(device, BluetoothProfile.PRIORITY_ON);
        }
    }

    private void processProfileStateChanged(BluetoothDevice device, int profileId, int newState, int prevState) {