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

Commit 4feb9df5 authored by Rahul Sabnis's avatar Rahul Sabnis Committed by android-build-merger
Browse files

Merge "BluetoothAdapter.disconnectAllEnabledProfiles() now disconnects pbap...

Merge "BluetoothAdapter.disconnectAllEnabledProfiles() now disconnects pbap server and map profiles"
am: 4320d764

Change-Id: I4f7605ce06e41064e89f5c97dd5c6acfd1cc3497
parents b6849a6d 4320d764
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2462,9 +2462,14 @@ public class AdapterService extends Service {
        }
        if (mMapClientService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.MAP_CLIENT, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting MAP");
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting MAP Client");
            mMapClientService.disconnect(device);
        }
        if (mMapService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.MAP, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting MAP");
            mMapService.disconnect(device);
        }
        if (mHidDeviceService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.HID_DEVICE, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting Hid Device Profile");
@@ -2482,9 +2487,14 @@ public class AdapterService extends Service {
        }
        if (mPbapClientService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.PBAP_CLIENT, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting Pbap");
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting Pbap Client");
            mPbapClientService.disconnect(device);
        }
        if (mPbapService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.PBAP, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting Pbap Server");
            mPbapService.disconnect(device);
        }
        if (mHearingAidService != null && isSupported(localDeviceUuids, remoteDeviceUuids,
                BluetoothProfile.HEARING_AID, device)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting Hearing Aid Profile");
+5 −1
Original line number Diff line number Diff line
@@ -493,7 +493,11 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
        return false;
    }

    void disconnect(BluetoothDevice device) {
    /**
     * Disconnects pbap server profile with device
     * @param device is the remote bluetooth device
     */
    public void disconnect(BluetoothDevice device) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission");
        synchronized (mPbapStateMachineMap) {
            PbapStateMachine sm = mPbapStateMachineMap.get(device);