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

Commit df17a111 authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by Android (Google) Code Review
Browse files

Merge "Increase logging around auto-routing to watch." into main

parents 264aad6a 4ef89896
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2024,6 +2024,7 @@ public class CallAudioRouteStateMachine extends StateMachine {

    private boolean isWatchActiveOrOnlyWatchesAvailable() {
        if (!mFeatureFlags.ignoreAutoRouteToWatchDevice()) {
            Log.i(this, "isWatchActiveOrOnlyWatchesAvailable: Flag is disabled.");
            return false;
        }

@@ -2041,9 +2042,12 @@ public class CallAudioRouteStateMachine extends StateMachine {
        }

        // Don't ignore switch if watch is already the active device.
        return containsWatchDevice && !containsNonWatchDevice
                && !mBluetoothRouteManager.isWatch(
        boolean isActiveDeviceWatch = mBluetoothRouteManager.isWatch(
                mBluetoothRouteManager.getBluetoothAudioConnectedDevice());
        Log.i(this, "isWatchActiveOrOnlyWatchesAvailable: contains watch: %s, contains "
                + "non-wearable device: %s, is active device a watch: %s.",
                containsWatchDevice, containsNonWatchDevice, isActiveDeviceWatch);
        return containsWatchDevice && !containsNonWatchDevice && !isActiveDeviceWatch;
    }

    private int calculateBaselineRouteMessage(boolean isExplicitUserRequest,
+2 −0
Original line number Diff line number Diff line
@@ -686,6 +686,7 @@ public class BluetoothRouteManager extends StateMachine {
        BluetoothClass deviceClass = device.getBluetoothClass();
        if (deviceClass != null && deviceClass.getDeviceClass()
                == BluetoothClass.Device.WEARABLE_WRIST_WATCH) {
            Log.i(this, "isWatch: bluetooth class component is a WEARABLE_WRIST_WATCH.");
            return true;
        }

@@ -696,6 +697,7 @@ public class BluetoothRouteManager extends StateMachine {
        }
        String deviceTypeStr = new String(deviceType);
        if (deviceTypeStr.equals(BluetoothDevice.DEVICE_TYPE_WATCH)) {
            Log.i(this, "isWatch: bluetooth device type is DEVICE_TYPE_WATCH.");
            return true;
        }