Loading services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java +14 −8 Original line number Diff line number Diff line Loading @@ -123,14 +123,17 @@ public class UsbDescriptorParser { ByteStream stream = new ByteStream(descriptors); while (stream.available() > 0) { UsbDescriptor descriptor = allocDescriptor(stream); UsbDescriptor descriptor = null; try { descriptor = allocDescriptor(stream); } catch (Exception ex) { Log.e(TAG, "Exception allocating USB descriptor.", ex); } if (descriptor != null) { // Parse try { descriptor.parseRawDescriptors(stream); } catch (Exception ex) { Log.e(TAG, "Exception parsing USB descriptors.", ex); } // Its OK to add the invalid descriptor as the postParse() // routine will mark it as invalid. Loading @@ -138,6 +141,9 @@ public class UsbDescriptorParser { // Clean up descriptor.postParse(stream); } catch (Exception ex) { Log.e(TAG, "Exception parsing USB descriptors.", ex); } } } } Loading Loading
services/usb/java/com/android/server/usb/descriptors/UsbDescriptorParser.java +14 −8 Original line number Diff line number Diff line Loading @@ -123,14 +123,17 @@ public class UsbDescriptorParser { ByteStream stream = new ByteStream(descriptors); while (stream.available() > 0) { UsbDescriptor descriptor = allocDescriptor(stream); UsbDescriptor descriptor = null; try { descriptor = allocDescriptor(stream); } catch (Exception ex) { Log.e(TAG, "Exception allocating USB descriptor.", ex); } if (descriptor != null) { // Parse try { descriptor.parseRawDescriptors(stream); } catch (Exception ex) { Log.e(TAG, "Exception parsing USB descriptors.", ex); } // Its OK to add the invalid descriptor as the postParse() // routine will mark it as invalid. Loading @@ -138,6 +141,9 @@ public class UsbDescriptorParser { // Clean up descriptor.postParse(stream); } catch (Exception ex) { Log.e(TAG, "Exception parsing USB descriptors.", ex); } } } } Loading