Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 827a5a25 authored by Paul Mclean's avatar Paul Mclean Committed by android-build-merger
Browse files

Merge "Merge "Fix exceptions causing HTC dongle (and JBL headset) to fail...

Merge "Merge "Fix exceptions causing HTC dongle (and JBL headset) to fail connection logic." into oc-dr1-dev am: f3562ffd am: 3e62b611" into oc-mr1-dev-plus-aosp
am: a7e1dbbe

Change-Id: I004ea8867a4dd6fd33078285ac4fc0d7b6202cc7
parents bdd6289a a7e1dbbe
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -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.
@@ -138,6 +141,9 @@ public class UsbDescriptorParser {

                    // Clean up
                    descriptor.postParse(stream);
                } catch (Exception ex) {
                    Log.e(TAG, "Exception parsing USB descriptors.", ex);
                }
            }
        }
    }