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

Commit dbfc61c6 authored by Juffin Alex Varghese's avatar Juffin Alex Varghese Committed by Linux Build Service Account
Browse files

Bluetooth: Avoid Broadcasting ACTION_DISCOVERY_STARTED intent again

This change will avoid broadcasting ACTION_DISCOVERY_STARTED intent again
if mDiscovering is set. Otherwise some of the currently discovered devices
are removed from device list.

CRs-Fixed: 523374
Change-Id: I1166f59d48229213c554a53a10aca9078a5aa5cd
parent af027801
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -647,14 +647,14 @@ class AdapterProperties {
        }
    }
    void discoveryStateChangeCallback(int state) {
        infoLog("Callback:discoveryStateChangeCallback with state:" + state);
        infoLog("Callback:discoveryStateChangeCallback with state:" + state + " disc: " + mDiscovering);
        synchronized (mObject) {
            Intent intent;
            if (state == AbstractionLayer.BT_DISCOVERY_STOPPED) {
                mDiscovering = false;
                intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
                mService.sendBroadcast(intent, mService.BLUETOOTH_PERM);
            } else if (state == AbstractionLayer.BT_DISCOVERY_STARTED) {
            } else if ((state == AbstractionLayer.BT_DISCOVERY_STARTED) && !mDiscovering) {
                mDiscovering = true;
                intent = new Intent(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
                mService.sendBroadcast(intent, mService.BLUETOOTH_PERM);