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

Commit 58dd1fa3 authored by Arthur Hsu's avatar Arthur Hsu
Browse files

Allow adapter callback to transition state machine

For ARC++ we need to be able to have the HAL asynchronously inform
the Bluetooth adapter state machine that the adapter has been
enabled or disabled. Add ENABLED_READY and DISABLED messages to the
OnState and OffState handlers, treating them the same as BLE_TURN_ON
and BLE_TURN_OFF messages.

Based on ag/885443

Bug: 62410651 69965109
Test: Build ok
Change-Id: I94a98735d1a6fb6b105cddd94e7e1dd5e80e700c
parent 86ddcab0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ final class AdapterState extends StateMachine {
            debugLog("Current state: OFF, message: " + msg.what);

            switch (msg.what) {
                case ENABLED_READY:
                case BLE_TURN_ON:
                    notifyAdapterStateChange(BluetoothAdapter.STATE_BLE_TURNING_ON);
                    mPendingCommandState.setBleTurningOn(true);
@@ -244,6 +245,7 @@ final class AdapterState extends StateMachine {
            debugLog("Current state: ON, message: " + msg.what);

            switch (msg.what) {
                case DISABLED:
                case BLE_TURN_OFF:
                    notifyAdapterStateChange(BluetoothAdapter.STATE_TURNING_OFF);
                    mPendingCommandState.setTurningOff(true);