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

Commit 15eed871 authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioManager: more log for getAvailableCommunicationDevices

Add log when no earpiece is reported by getAvailableCommunicationDevice
Bug: 381334864
Test: make
Flag: EXEMPT temporary log

Change-Id: I2319fd5bc07b3d6ea73bc757d7b3bac1cbe50e0d
parent a29e2f50
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
@@ -657,6 +657,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;
    }