Fix parsing of WM trace in critical mode

When tracing WM in critical mode, the children object is not always
assigned and this previously crashed the WM trace parsing in winscope.

Fix the WM trace parsing by assuming all null children as empty arrays

Test: run winscope, collect critical trace, open critical trace in winscope
Change-Id: I108c0725f3e9a27f45fda790d411614e0ab988bf
This commit is contained in:
Nataniel Borges
2021-09-29 16:00:54 +02:00
parent e0af999e84
commit 386e618c5c

View File

@@ -272,6 +272,10 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> {
@Override
public void dumpDebug(ProtoOutputStream proto, long fieldId, int logLevel) {
if (logLevel == WindowTraceLogLevel.CRITICAL && !isVisible()) {
return;
}
final long token = proto.start(fieldId);
super.dumpDebug(proto, WINDOW_CONTAINER, logLevel);
proto.write(NAME, mName);