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

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

Make PBAP PCE (Client) role auto-connectable. am: 3c75851b

am: 53583358

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

Change-Id: I30a40902427d4fd3edd9be2d276dc847e3285d46
parents 1f6ba4f3 53583358
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) {