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

Commit b6a6c5bb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

Merge "BluetoothAdapter.disconnectAllEnabledProfiles() now disconnects pbap server and map profiles"
parents ef2d2a3d 80e3c691
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2460,9 +2460,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");
@@ -2480,9 +2485,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);