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

Commit 7d86ab10 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

HID: Send connection state change broadcast during cleanup

Usecase:
1) Connect HID device with DUT
2) Turn Off BT

Observation:
HID state change is not received by application leading to
application showing connected even when BT is turned off and
HID was connected.

Rootcause:
HidService does not send state change to application if BT is turned off
while connected

Fix:
Send broadcast for HID connection state change during cleanup.

Test: Verified that connection state change intent is received by upper layers
during BT off if HID was connected.

Bug: 35013637
Change-Id: I5d7989887f9089876c78e43d97d066f384cc237e
parent e7aed631
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -97,6 +97,12 @@ public class HidService extends ProfileService {
        }
        }


        if(mInputDevices != null) {
        if(mInputDevices != null) {
            for (BluetoothDevice device : mInputDevices.keySet()) {
                int inputDeviceState = getConnectionState(device);
                if (inputDeviceState != BluetoothProfile.STATE_DISCONNECTED) {
                    broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED);
                }
            }
            mInputDevices.clear();
            mInputDevices.clear();
        }
        }
        clearHidService();
        clearHidService();