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

Commit 0c7db8c4 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "AudioManager: more log for getAvailableCommunicationDevices" into main

parents dc393b4e 15eed871
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -9185,10 +9185,16 @@ public class AudioManager {
            for (int portId : portIds) {
                AudioDeviceInfo device = getDeviceForPortId(portId, GET_DEVICES_OUTPUTS);
                if (device == null) {
                    //TODO b/381334864: remove log when fixed
                    Log.w(TAG, "getAvailableCommunicationDevices: no device for ID: " + portId);
                    continue;
                }
                devices.add(device);
            }
            if (devices.stream().filter(d -> d.getType() == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE)
                    .findFirst().orElse(null) == null) {
                Log.w(TAG, "getAvailableCommunicationDevices: no EARPIECE!");
            }
            return devices;
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
+6 −0
Original line number Diff line number Diff line
@@ -658,6 +658,12 @@ public class AudioDeviceBroker {
                commDevices.add(device);
            }
        }
        //TODO b/381334864: remove log when fixed
        if (commDevices.stream().filter(d -> d.getType() == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE)
                .findFirst().orElse(null) == null) {
            AudioService.sDeviceLogger.enqueue((new EventLogger.StringEvent(
                    "getAvailableCommunicationDevices: no EARPIECE!")).printLog(TAG));
        }
        return commDevices;
    }