From 5f463e9e7f36bf39279a9b0b63db77b7c2274952 Mon Sep 17 00:00:00 2001 From: Kyunglyul Hyun Date: Wed, 23 Mar 2022 17:08:54 +0900 Subject: Set audio route name when LE audio device is connected This CL mainly affects how MediaRouter works. Without this, MediaRouter will not be aware of LE audio routes even when it's connected so any apps depending on MediaRouter could break. This CL makes MediaRouter shows an a2dp bluetooth route, which may not be correct but we need this for backward compatiblity. We can remove this when we deprecate MediaRouter. Tag: #feature Bug: 211079178 Test: pair LE HS and switch from/to Phone speaker through the output switcher Change-Id: I4fe81e000aa13c8d07573780e2abb99eba867f36 --- services/core/java/com/android/server/audio/AudioDeviceInventory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java index de4161163723..a3c6f0a68c78 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java +++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java @@ -1102,6 +1102,7 @@ public class AudioDeviceInventory { mConnectedDevices.put(DeviceInfo.makeDeviceListKey(device, address), new DeviceInfo(device, name, address, AudioSystem.AUDIO_FORMAT_DEFAULT)); mDeviceBroker.postAccessoryPlugMediaUnmute(device); + setCurrentAudioRouteNameIfPossible(name, /*fromA2dp=*/false); } if (streamType == AudioSystem.STREAM_DEFAULT) { -- cgit v1.2.3-59-g8ed1b