From b333d37ffc9bc0e08260a9db2d44e9b51770cf91 Mon Sep 17 00:00:00 2001 From: Cam Bickel Date: Thu, 14 Nov 2024 18:00:31 +0000 Subject: Use USB product name to set AlsaDevice name Rather than use the AlsaCardRecord card name to set the UsbAlsaDevice name when a USB device is added, this CL updates the code to use the USBDevice product name instead. For context, the AlsaCardRecord name has a prefix "USB-Audio -" that the USBDevice product name does not have. See these logs for context: https://screenshot.googleplex.com/A3SqMJaHdqT9xot Test: Manual Bug: b/379120512 Flag: EXEMPT bugfix Change-Id: I730ad62dd74bc21b726f04ee1c546272f1d4a7f0 --- services/usb/java/com/android/server/usb/UsbAlsaManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/usb/java/com/android/server/usb/UsbAlsaManager.java b/services/usb/java/com/android/server/usb/UsbAlsaManager.java index 5ef0fe346dc6..d976f5ba1af2 100644 --- a/services/usb/java/com/android/server/usb/UsbAlsaManager.java +++ b/services/usb/java/com/android/server/usb/UsbAlsaManager.java @@ -337,7 +337,7 @@ public final class UsbAlsaManager { deviceAddress, hasOutput, hasInput, isInputHeadset, isOutputHeadset, isDock); alsaDevice.setDeviceNameAndDescription( - cardRec.getCardName(), cardRec.getCardDescription()); + usbDevice.getProductName(), cardRec.getCardDescription()); if (IS_MULTI_MODE) { deselectCurrentDevice(alsaDevice.getInputDeviceType()); deselectCurrentDevice(alsaDevice.getOutputDeviceType()); -- cgit v1.2.3-59-g8ed1b