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

Commit ec15471c authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Bluetooth] Add more logs around active devices.

Bug: 257845933
Test: Verified logcat contained "CachedBluetoothDevice:
onActiveDeviceChanged:" logs when a device changes active states
Test: Verified BluetoothController dump contains active statuses
Change-Id: I788f4de1d4c2906df269c1f5b4fbee5431de9f08
parent 2c34290e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -668,6 +668,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
     * @param bluetoothProfile the Bluetooth profile
     */
    public void onActiveDeviceChanged(boolean isActive, int bluetoothProfile) {
        if (BluetoothUtils.D) {
            Log.d(TAG, "onActiveDeviceChanged: "
                    + "profile " + BluetoothProfile.getProfileName(bluetoothProfile)
                    + ", device " + mDevice.getAnonymizedAddress()
                    + ", isActive " + isActive);
        }
        boolean changed = false;
        switch (bluetoothProfile) {
        case BluetoothProfile.A2DP:
+7 −1
Original line number Diff line number Diff line
@@ -145,7 +145,13 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
    }

    private String getDeviceString(CachedBluetoothDevice device) {
        return device.getName() + " " + device.getBondState() + " " + device.isConnected();
        return device.getName()
                + " bondState=" + device.getBondState()
                + " connected=" + device.isConnected()
                + " active[A2DP]=" + device.isActiveDevice(BluetoothProfile.A2DP)
                + " active[HEADSET]=" + device.isActiveDevice(BluetoothProfile.HEADSET)
                + " active[HEARING_AID]=" + device.isActiveDevice(BluetoothProfile.HEARING_AID)
                + " active[LE_AUDIO]=" + device.isActiveDevice(BluetoothProfile.LE_AUDIO);
    }

    @Override