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

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

Merge "AudioDeviceCallback: Resolve null type from map reference." into main

parents 780199d1 61c90b15
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -230,10 +230,12 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
            @Override
            public void onCommunicationDeviceChanged(AudioDeviceInfo device) {
                @AudioRoute.AudioRouteType int audioType = device != null
                        ? DEVICE_INFO_TYPE_TO_AUDIO_ROUTE_TYPE.get(device.getType())
                        ? DEVICE_INFO_TYPE_TO_AUDIO_ROUTE_TYPE.getOrDefault(
                                device.getType(), TYPE_INVALID)
                        : TYPE_INVALID;
                Log.i(this, "onCommunicationDeviceChanged: %d", audioType);
                if (device != null && device.getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER) {
                Log.i(this, "onCommunicationDeviceChanged: device (%s), audioType (%d)",
                        device, audioType);
                if (audioType == TYPE_SPEAKER) {
                    if (mCurrentRoute.getType() != TYPE_SPEAKER) {
                        sendMessageWithSessionInfo(SPEAKER_ON);
                    }