summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kyunglyul Hyun <klhyun@google.com> 2022-03-23 17:08:54 +0900
committer Kyunglyul Hyun <klhyun@google.com> 2022-03-23 18:00:18 +0900
commit5f463e9e7f36bf39279a9b0b63db77b7c2274952 (patch)
tree98f3ee421bde6687f0dfe991c28c365dbd73bca8
parentb344dfaee95be045a58913a0fd81d9c532684d42 (diff)
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
-rw-r--r--services/core/java/com/android/server/audio/AudioDeviceInventory.java1
1 files changed, 1 insertions, 0 deletions
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) {