Merge "MidiDeviceInfo: Add version string property" into mnc-dev

This commit is contained in:
Mike Lockwood
2015-04-29 20:50:34 +00:00
committed by Android (Google) Code Review
4 changed files with 11 additions and 0 deletions

View File

@@ -17267,6 +17267,7 @@ package android.media.midi {
field public static final java.lang.String PROPERTY_PRODUCT = "product";
field public static final java.lang.String PROPERTY_SERIAL_NUMBER = "serial_number";
field public static final java.lang.String PROPERTY_USB_DEVICE = "usb_device";
field public static final java.lang.String PROPERTY_VERSION = "version";
field public static final int TYPE_BLUETOOTH = 3; // 0x3
field public static final int TYPE_USB = 1; // 0x1
field public static final int TYPE_VIRTUAL = 2; // 0x2

View File

@@ -18559,6 +18559,7 @@ package android.media.midi {
field public static final java.lang.String PROPERTY_PRODUCT = "product";
field public static final java.lang.String PROPERTY_SERIAL_NUMBER = "serial_number";
field public static final java.lang.String PROPERTY_USB_DEVICE = "usb_device";
field public static final java.lang.String PROPERTY_VERSION = "version";
field public static final int TYPE_BLUETOOTH = 3; // 0x3
field public static final int TYPE_USB = 1; // 0x1
field public static final int TYPE_VIRTUAL = 2; // 0x2

View File

@@ -68,6 +68,13 @@ public final class MidiDeviceInfo implements Parcelable {
*/
public static final String PROPERTY_PRODUCT = "product";
/**
* Bundle key for the device's version property.
* Used with the {@link android.os.Bundle} returned by {@link #getProperties}
* Matches the USB device version number for USB MIDI devices.
*/
public static final String PROPERTY_VERSION = "version";
/**
* Bundle key for the device's serial number property.
* Used with the {@link android.os.Bundle} returned by {@link #getProperties}

View File

@@ -401,6 +401,7 @@ public final class UsbAlsaManager {
Bundle properties = new Bundle();
String manufacturer = usbDevice.getManufacturerName();
String product = usbDevice.getProductName();
String version = usbDevice.getVersion();
String name;
if (manufacturer == null || manufacturer.isEmpty()) {
name = product;
@@ -412,6 +413,7 @@ public final class UsbAlsaManager {
properties.putString(MidiDeviceInfo.PROPERTY_NAME, name);
properties.putString(MidiDeviceInfo.PROPERTY_MANUFACTURER, manufacturer);
properties.putString(MidiDeviceInfo.PROPERTY_PRODUCT, product);
properties.putString(MidiDeviceInfo.PROPERTY_VERSION, version);
properties.putString(MidiDeviceInfo.PROPERTY_SERIAL_NUMBER,
usbDevice.getSerialNumber());
properties.putInt(MidiDeviceInfo.PROPERTY_ALSA_CARD, alsaDevice.mCard);