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

Commit 3cc77584 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

BluetoothServices: On unbond disconnected services if needed

Without this patch, service state machines might end up in connected
state even for already unbonded devices

Bug: 242645864
Tag: #feature
Test: atest BluetoothInstrumenatationTests
Change-Id: I16a83e5bc741ed7c0978000cd27bdbe7238d5c63
parent 18943264
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -636,6 +636,8 @@ public class BassClientService extends ProfileService {
                return;
            }
            if (sm.getConnectionState() != BluetoothProfile.STATE_DISCONNECTED) {
                Log.i(TAG, "Disconnecting device because it was unbonded.");
                disconnect(device);
                return;
            }
            removeStateMachine(device);
+2 −0
Original line number Diff line number Diff line
@@ -906,6 +906,8 @@ public class CsipSetCoordinatorService extends ProfileService {
                return;
            }
            if (sm.getConnectionState() != BluetoothProfile.STATE_DISCONNECTED) {
                Log.i(TAG, "Disconnecting device because it was unbonded.");
                disconnect(device);
                return;
            }
            removeStateMachine(device);
+2 −0
Original line number Diff line number Diff line
@@ -267,6 +267,8 @@ public class HapClientService extends ProfileService {
                return;
            }
            if (sm.getConnectionState() != BluetoothProfile.STATE_DISCONNECTED) {
                Log.i(TAG, "Disconnecting device because it was unbonded.");
                disconnect(device);
                return;
            }
            removeStateMachine(device);
+2 −0
Original line number Diff line number Diff line
@@ -777,6 +777,8 @@ public class HearingAidService extends ProfileService {
                return;
            }
            if (sm.getConnectionState() != BluetoothProfile.STATE_DISCONNECTED) {
                Log.i(TAG, "Disconnecting device because it was unbonded.");
                disconnect(device);
                return;
            }
            removeStateMachine(device);
+2 −0
Original line number Diff line number Diff line
@@ -984,6 +984,8 @@ public class VolumeControlService extends ProfileService {
                return;
            }
            if (sm.getConnectionState() != BluetoothProfile.STATE_DISCONNECTED) {
                Log.i(TAG, "Disconnecting device because it was unbonded.");
                disconnect(device);
                return;
            }
            removeStateMachine(device);