Add user visible name for USB peripheral MIDI device
Change-Id: I075a54dc3890bc5cf3927cecba3750e1d342d290
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index a48e964..601f01a 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -5232,10 +5232,12 @@
<string name="stk_cc_ss_to_ussd">SS request is modified to USSD request.</string>
<string name="stk_cc_ss_to_ss">SS request is modified to new SS request.</string>
+ <!-- User visible name for USB MIDI Peripheral port -->
+ <string name="usb_midi_peripheral_name">Android USB Peripheral Port</string>
<!-- Manufacturer name for USB MIDI Peripheral port -->
<string name="usb_midi_peripheral_manufacturer_name">Android</string>
- <!-- Model name for USB MIDI Peripheral port -->
- <string name="usb_midi_peripheral_model_name">USB Peripheral Port</string>
+ <!-- Product name for USB MIDI Peripheral port -->
+ <string name="usb_midi_peripheral_product_name">USB Peripheral Port</string>
<!-- Floating toolbar strings -->
<!-- Content description for the button that opens the floating toolbar overflow. [CHAR LIMIT=NONE] -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index c2c00b5..4f1980f 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2182,8 +2182,9 @@
<java-symbol type="bool" name="config_LTE_eri_for_network_name" />
<java-symbol type="bool" name="config_defaultInTouchMode" />
+ <java-symbol type="string" name="usb_midi_peripheral_name" />
<java-symbol type="string" name="usb_midi_peripheral_manufacturer_name" />
- <java-symbol type="string" name="usb_midi_peripheral_model_name" />
+ <java-symbol type="string" name="usb_midi_peripheral_product_name" />
<java-symbol type="bool" name="allow_stacked_button_bar" />
<java-symbol type="id" name="spacer" />
diff --git a/services/usb/java/com/android/server/usb/UsbAlsaManager.java b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
index 2728af1..8f0c6c8 100644
--- a/services/usb/java/com/android/server/usb/UsbAlsaManager.java
+++ b/services/usb/java/com/android/server/usb/UsbAlsaManager.java
@@ -469,10 +469,12 @@
if (enabled && mPeripheralMidiDevice == null) {
Bundle properties = new Bundle();
Resources r = mContext.getResources();
+ properties.putString(MidiDeviceInfo.PROPERTY_NAME, r.getString(
+ com.android.internal.R.string.usb_midi_peripheral_name));
properties.putString(MidiDeviceInfo.PROPERTY_MANUFACTURER, r.getString(
com.android.internal.R.string.usb_midi_peripheral_manufacturer_name));
properties.putString(MidiDeviceInfo.PROPERTY_PRODUCT, r.getString(
- com.android.internal.R.string.usb_midi_peripheral_model_name));
+ com.android.internal.R.string.usb_midi_peripheral_product_name));
properties.putInt(MidiDeviceInfo.PROPERTY_ALSA_CARD, card);
properties.putInt(MidiDeviceInfo.PROPERTY_ALSA_DEVICE, device);
mPeripheralMidiDevice = UsbMidiDevice.create(mContext, properties, card, device);