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

Commit 20868936 authored by Myles Watson's avatar Myles Watson
Browse files

btservice: Log names for adapter states

Bug: 67460963
Test: runtest bluetooth, Toggle Bluetooth
Change-Id: Iead5eb4f1844157a02d256fc4e9e1902001a01f1
parent 23069485
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -52,7 +52,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
class AdapterProperties {
class AdapterProperties {
    private static final boolean DBG = true;
    private static final boolean DBG = true;
    private static final boolean VDBG = false;
    private static final boolean VDBG = false;
    private static final String TAG = "BluetoothAdapterProperties";
    private static final String TAG = "AdapterProperties";


    private static final String MAX_CONNECTED_AUDIO_DEVICES_PROPERTY =
    private static final String MAX_CONNECTED_AUDIO_DEVICES_PROPERTY =
            "persist.bluetooth.maxconnectedaudiodevices";
            "persist.bluetooth.maxconnectedaudiodevices";
@@ -311,7 +311,7 @@ class AdapterProperties {
     * @param mState the mState to set
     * @param mState the mState to set
     */
     */
    void setState(int mState) {
    void setState(int mState) {
        debugLog("Setting state to " + mState);
        debugLog("Setting state to " + BluetoothAdapter.nameForState(mState));
        this.mState = mState;
        this.mState = mState;
    }
    }


+2 −1
Original line number Original line Diff line number Diff line
@@ -590,7 +590,8 @@ public class AdapterService extends Service {
    void updateAdapterState(int prevState, int newState) {
    void updateAdapterState(int prevState, int newState) {
        if (mCallbacks != null) {
        if (mCallbacks != null) {
            int n = mCallbacks.beginBroadcast();
            int n = mCallbacks.beginBroadcast();
            debugLog("updateAdapterState() - Broadcasting state to " + n + " receivers.");
            debugLog("updateAdapterState() - Broadcasting state " + BluetoothAdapter.nameForState(
                    newState) + " to " + n + " receivers.");
            for (int i = 0; i < n; i++) {
            for (int i = 0; i < n; i++) {
                try {
                try {
                    mCallbacks.getBroadcastItem(i).onBluetoothStateChange(prevState, newState);
                    mCallbacks.getBroadcastItem(i).onBluetoothStateChange(prevState, newState);
+2 −1
Original line number Original line Diff line number Diff line
@@ -525,7 +525,8 @@ final class AdapterState extends StateMachine {


        int oldState = adapterProperties.getState();
        int oldState = adapterProperties.getState();
        adapterProperties.setState(newState);
        adapterProperties.setState(newState);
        infoLog("Bluetooth adapter state changed: " + oldState + "-> " + newState);
        infoLog("Bluetooth adapter state changed: " + BluetoothAdapter.nameForState(oldState)
                + "-> " + BluetoothAdapter.nameForState(newState));
        adapterService.updateAdapterState(oldState, newState);
        adapterService.updateAdapterState(oldState, newState);
    }
    }