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

Commit dfb8ec4a authored by pramod kotreshappa's avatar pramod kotreshappa Committed by Ricardo Cerqueira
Browse files

Bluetooth: Handle BT state change

Add foreground flag to state change intent. Fix for few profiles
not syncing with the BT adapter state in multiple BT on/off test
case.

CRs-fixed: 709335

Change-Id: Ice042a21f08566cadc9540aa75cde726b2e86575
parent ab37fe81
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1172,6 +1172,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, prevState);
            intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState);
            intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            if (DBG) Log.d(TAG,"Bluetooth State Change Intent: " + prevState + " -> " + newState);
            mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
                    BLUETOOTH_PERM);