diff --git a/services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java b/services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java index c02110186d8de..0798488298048 100644 --- a/services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java +++ b/services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java @@ -177,11 +177,15 @@ public final class UsbDescriptorParser { * Audio Class Specific */ case UsbDescriptor.DESCRIPTORTYPE_AUDIO_INTERFACE: - descriptor = UsbACInterface.allocDescriptor(this, stream, length, type); + if (mDeviceDescriptor.getDevClass() == UsbDescriptor.CLASSID_AUDIO) { + descriptor = UsbACInterface.allocDescriptor(this, stream, length, type); + } break; case UsbDescriptor.DESCRIPTORTYPE_AUDIO_ENDPOINT: - descriptor = UsbACEndpoint.allocDescriptor(this, length, type); + if (mDeviceDescriptor.getDevClass() == UsbDescriptor.CLASSID_AUDIO) { + descriptor = UsbACEndpoint.allocDescriptor(this, length, type); + } break; default: