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

Commit 350f9960 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Gerrit - the friendly Code Review server
Browse files

Bluetooth: Setting bluetooth.isEnabled on BT state change

btwlancoex process starts based on the bluetooth.isEnabled
property which is used to indicate Bluetooth on/off. If BT is
already turned on before rebooting the phone. btwlancoex process
does not start, As  property is not getting set, Even though
bluetooth is turned on successfully after rebooting phone, if
bluedroid stack is enabled. Setting the property from adapter
state,Once BT state change(ON or OFF) is recieved from
abstraction layer in bluedroid stack.

Change-Id: I511c8213f649d797aa012c747001ed6985a2b15d
parent a879167c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.Log;

import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import android.os.SystemProperties;

/**
 * This state machine handles Bluetooth Adapter State.
@@ -375,9 +376,11 @@ final class AdapterState extends StateMachine {

    void stateChangeCallback(int status) {
        if (status == AbstractionLayer.BT_STATE_OFF) {
            SystemProperties.set("bluetooth.isEnabled","false");
            sendMessage(DISABLED);
        } else if (status == AbstractionLayer.BT_STATE_ON) {
            // We should have got the property change for adapter and remote devices.
            SystemProperties.set("bluetooth.isEnabled","true");
            sendMessage(ENABLED_READY);
        } else {
            errorLog("Incorrect status in stateChangeCallback");