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

Commit 5f913453 authored by M Safoorah Banu's avatar M Safoorah Banu Committed by Bruno Martins
Browse files

BT: API to update quiet mode status in Adapter service [2/3]

 - In BLE on use case, quiet mode status is not updated to
   Adapter service which results in not initiating auto
   connection of hfp & a2dp though quiet mode is disabled
   for next turn On.

 - Added new API to update quiet mode status in Adapter
   service.

CRs-Fixed: 2337538
Change-Id: I49a604b7996024fd9fd498fb7cc6aafc208517a5
parent c9a4058e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1065,6 +1065,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            }
            if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {
                // This triggers transition to STATE_ON
                mBluetooth.updateQuietModeStatus(mQuietEnable);
                mBluetooth.onLeServiceUp(mContext.getAttributionSource());
                persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
            }
@@ -1869,6 +1870,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                    mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
                    mEnable = true;

                    mQuietEnable = (msg.arg1 == 1);
                    // Use service interface to get the exact state
                    try {
                        mBluetoothLock.readLock().lock();
@@ -1881,6 +1883,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                                        Slog.i(TAG, "Already at BLE_ON State");
                                    } else {
                                        Slog.w(TAG, "BT Enable in BLE_ON State, going to ON");
                                        mBluetooth.updateQuietModeStatus(mQuietEnable);
                                        mBluetooth.onLeServiceUp(mContext.getAttributionSource());
                                        persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
                                    }