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

Commit 62cba90d authored by Srinu Jella's avatar Srinu Jella Committed by Andre Eisenbach
Browse files

Stop profile services when Bluetooth enable times out

While moving from OFF to BLE_ON state, we are able to switch
BLE_TURNING_ON state which starts the enable_timeout timer. After timing
out we are stopping profiles other than BLE which may still be active
and can send callbacks while clean-up is in process or complete.

Bug: 27678483
Change-Id: I75d88024a60967fb516ebd0941e8e216d00c20f6
parent e967003b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -437,6 +437,7 @@ final class AdapterState extends StateMachine {
                case BREDR_START_TIMEOUT:
                    errorLog("Error enabling Bluetooth (start timeout)");
                    mPendingCommandState.setTurningOn(false);
                    adapterService.stopProfileServices();
                    transitionTo(mBleOnState);
                    notifyAdapterStateChange(BluetoothAdapter.STATE_BLE_ON);
                    break;
@@ -445,6 +446,8 @@ final class AdapterState extends StateMachine {
                    errorLog("Error enabling Bluetooth (enable timeout)");
                    mPendingCommandState.setBleTurningOn(false);
                    transitionTo(mOffState);
                    adapterService.stopProfileServices();
                    adapterService.stopGattProfileService();
                    notifyAdapterStateChange(BluetoothAdapter.STATE_OFF);
                    break;