Replace parsing error stack dump with a more terse message

Bug: 147608995
Test: boot, connect PreSonus AudioBox 22VSL, pull log and examine.
Change-Id: I49629267c91cea5d6ba8a76af956cd3306c1d8b1
This commit is contained in:
Paul McLean
2020-01-29 15:47:24 -07:00
parent 8248661d25
commit c9b7cb2fc2

View File

@@ -292,9 +292,27 @@ public final class UsbDescriptorParser {
// Clean up
descriptor.postParse(stream);
} catch (Exception ex) {
Log.e(TAG, "Exception parsing USB descriptors.", ex);
// Clean up, compute error status
descriptor.postParse(stream);
// Clean up
// 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());
}
// Finish up
descriptor.setStatus(UsbDescriptor.STATUS_PARSE_EXCEPTION);
} finally {
mDescriptors.add(descriptor);