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

Commit 1440c675 authored by Jeremy Wu's avatar Jeremy Wu
Browse files

InputRouteManager: add logs on deviceAdded

Bug: 411019255
Test: verify logs
Flag: EXEMPT add logs
Change-Id: I09496c0b48cc97182ee9a187de552fc0301ae426
parent f24b2e90
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public final class InputRouteManager {
            new AudioDeviceCallback() {
                @Override
                public void onAudioDevicesAdded(@NonNull AudioDeviceInfo[] addedDevices) {
                    Slog.v(TAG, "onAudioDevicesAdded");
                    applyDefaultSelectedTypeToAllPresets();

                    // Activate the last hot plugged valid input device, to match the output device
@@ -85,6 +86,13 @@ public final class InputRouteManager {
                    @AudioDeviceType int deviceTypeToActivate = mSelectedInputDeviceType;
                    String deviceAddrToActivate = mSelectedInputDeviceAddr;
                    for (AudioDeviceInfo info : addedDevices) {
                        Slog.v(TAG,
                                "onAudioDevicesAdded: enumerating"
                                + ": type=" + info.getType()
                                + ", name=" + info.getProductName()
                                + ", isSource=" + info.isSource()
                                + ", isSink=" + info.isSink());

                        if (!info.isSource()) {
                            continue;
                        }
@@ -97,6 +105,8 @@ public final class InputRouteManager {
                        // exist previously.
                        if (InputMediaDevice.isSupportedInputDevice(type)
                                && findDeviceByTypeAndAddress(type, addr) == null) {
                            Slog.v(TAG,
                                    "onAudioDevicesAdded: updated type=" + type + ", addr=" + addr);
                            deviceTypeToActivate = type;
                            deviceAddrToActivate = addr;
                        }
@@ -314,6 +324,9 @@ public final class InputRouteManager {
        mSelectedInputDeviceType = inputMediaDevice.getAudioDeviceInfoType();
        mSelectedInputDeviceAddr = inputMediaDevice.getAddress();

        Slog.v(TAG, "User selected device: type=" + mSelectedInputDeviceType
                + ", addr=" + mSelectedInputDeviceAddr);

        AudioDeviceAttributes deviceAttributes =
                createInputDeviceAttributes(mSelectedInputDeviceType, mSelectedInputDeviceAddr);
        try {