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

Commit 415f0ea8 authored by Shunkai Yao's avatar Shunkai Yao Committed by Android (Google) Code Review
Browse files

Merge "Add device logger for active device and action state change" into main

parents e65f6c72 484fac0f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -7636,6 +7636,10 @@ public class AudioService extends IAudioService.Stub
            throw new IllegalArgumentException("Illegal BluetoothProfile profile for device "
                    + previousDevice + " -> " + newDevice + ". Got: " + profile);
        }
        sDeviceLogger.enqueue(new EventLogger.StringEvent("BlutoothActiveDeviceChanged for "
                + BluetoothProfile.getProfileName(profile) + ", device update " + previousDevice
                + " -> " + newDevice));
        AudioDeviceBroker.BtDeviceChangedData data =
                new AudioDeviceBroker.BtDeviceChangedData(newDevice, previousDevice, info,
                        "AudioService");
@@ -9685,6 +9689,9 @@ public class AudioService extends IAudioService.Stub
                }
            } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
                state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
                sDeviceLogger.enqueue(new EventLogger.StringEvent(
                        "BluetoothAdapter ACTION_STATE_CHANGED with state " + state));
                if (state == BluetoothAdapter.STATE_OFF ||
                        state == BluetoothAdapter.STATE_TURNING_OFF) {
                    mDeviceBroker.disconnectAllBluetoothProfiles();
+5 −0
Original line number Diff line number Diff line
@@ -459,6 +459,8 @@ public class BtHelper {

    //@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
    /*package*/ synchronized void onBtProfileDisconnected(int profile) {
        AudioService.sDeviceLogger.enqueue(new EventLogger.StringEvent(
                "BT profile " + BluetoothProfile.getProfileName(profile) + " disconnected"));
        switch (profile) {
            case BluetoothProfile.A2DP:
                mA2dp = null;
@@ -487,6 +489,9 @@ public class BtHelper {

    @GuardedBy("AudioDeviceBroker.mDeviceStateLock")
    /*package*/ synchronized void onBtProfileConnected(int profile, BluetoothProfile proxy) {
        AudioService.sDeviceLogger.enqueue(new EventLogger.StringEvent(
                "BT profile " + BluetoothProfile.getProfileName(profile) + " connected to proxy "
                + proxy));
        if (profile == BluetoothProfile.HEADSET) {
            onHeadsetProfileConnected((BluetoothHeadset) proxy);
            return;