Fix property view for non flicker traces in winscope

There are 2 types of object whose properties can appear in the property
list: Flicker objects (WM/SF traces) and dictionaries
(IME/Accessibilty/Transactions).

While flicker objects have their properties directly in the main object,
those created by a call to the transform function have their properties
inside an obj property.

This CL makes flicker support both implementations

Bug: 167521734
Bug: 209452852
Test: run winscope and collect a transactions trace
Change-Id: I7103ef078cf62331fd45c45fd238173232993f47
This commit is contained in:
Nataniel Borges
2021-12-06 17:42:02 +01:00
parent 83b075db80
commit 9cc1353195

View File

@@ -216,8 +216,17 @@ export default {
},
getTransformedProperties(item) {
ObjectFormatter.displayDefaults = this.displayDefaults;
// There are 2 types of object whose properties can appear in the property
// list: Flicker objects (WM/SF traces) and dictionaries
// (IME/Accessibilty/Transactions).
// While flicker objects have their properties directly in the main object,
// those created by a call to the transform function have their properties
// inside an obj property. This makes both cases work
// TODO(209452852) Refactor both flicker and winscope-native objects to
// implement a common display interface that can be better handled
const target = item.obj ?? item;
const transformer = new ObjectTransformer(
getPropertiesForDisplay(item),
getPropertiesForDisplay(target),
item.name,
stableIdCompatibilityFixup(item),
).setOptions({