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

Commit e37a75cc authored by Paul Mclean's avatar Paul Mclean Committed by Android (Google) Code Review
Browse files

Merge "Replace parsing error stack dump with a more terse message"

parents e75d0ca7 c9b7cb2f
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -292,9 +292,27 @@ public final class UsbDescriptorParser {
                    // Clean up
                    descriptor.postParse(stream);
                } catch (Exception ex) {
                    // Clean up, compute error status
                    descriptor.postParse(stream);

                    // Report
                    Log.w(TAG, "Exception parsing USB descriptors. type:0x" + descriptor.getType()
                            + " status:" + descriptor.getStatus());
                    if (DEBUG) {
                        // Show full stack trace if debugging
                        Log.e(TAG, "Exception parsing USB descriptors.", ex);
                    }
                    StackTraceElement[] stackElems = ex.getStackTrace();
                    if (stackElems.length > 0) {
                        Log.i(TAG, "  class:" + stackElems[0].getClassName()
                                    + " @ " + stackElems[0].getLineNumber());
                    }
                    if (stackElems.length > 1) {
                        Log.i(TAG, "  class:" + stackElems[1].getClassName()
                                + " @ " + stackElems[1].getLineNumber());
                    }

                    // Clean up
                    // Finish up
                    descriptor.setStatus(UsbDescriptor.STATUS_PARSE_EXCEPTION);
                } finally {
                    mDescriptors.add(descriptor);