3/ Simplify WM parsing on Winscope

- Use flicker class type as object type
- Use name from flicker
- Use stableID from flicker
- Refactor element visibility
- Rename `childrenWindows` to children to avoid creating a new property

Bug: 185516271
Test: build winscope and open WM traces
Change-Id: I582c0fe4ac48f8a503d1dccfbce437d489a50ca7
This commit is contained in:
Nataniel Borges
2021-04-23 12:04:19 +02:00
parent b3dd38e0b7
commit 06a596be4d
9 changed files with 19 additions and 14 deletions

View File

@@ -28,7 +28,13 @@ export default {
},
methods: {
summarizer(item) {
return null;
const summary = [];
if (item.obj.isIncompleteReason) {
summary.push({key: 'Incomplete state reason', value: item.obj.isIncompleteReason});
}
return summary;
},
}
}

View File

@@ -50,14 +50,14 @@ WindowManagerState.fromProto = function ({proto, timestamp = 0, where = ""}): Wi
timestamp = timestamp
)
entry.kind = entry.constructor.name
entry.rects = entry.windowStates.reverse().map(it => it.rect)
entry.obj = getWMPropertiesForDisplay(proto)
entry.obj["isComplete"] = entry.isComplete()
if (!entry.obj.isComplete) {
entry.obj["isIncompleteReason"] = entry.getIsIncompleteReason()
}
entry.name = nanosToString(entry.timestamp, TimeUnits.MILLI_SECONDS)
entry.shortName = entry.name
entry.children = entry.root.childrenWindows.reverse()
entry.chips = []
entry.visible = true
entry.rawTreeViewObject = asRawTreeViewObject(entry)

View File

@@ -42,8 +42,8 @@ Activity.fromProto = function (proto): Activity {
)
entry.obj = getWMPropertiesForDisplay(proto)
entry.kind = entry.constructor.name
entry.shortName = shortenName(entry.name)
entry.children = entry.childrenWindows
entry.rawTreeViewObject = asRawTreeViewObject(entry)
console.warn("Created ", entry.kind, " stableId=", entry.stableId)

View File

@@ -53,8 +53,8 @@ ActivityTask.fromProto = function (proto, isActivityInTree: Boolean): ActivityTa
)
entry.obj = getWMPropertiesForDisplay(proto)
entry.kind = entry.constructor.name
entry.shortName = shortenName(entry.name)
entry.children = entry.childrenWindows
entry.rawTreeViewObject = asRawTreeViewObject(entry)
console.warn("Created ", entry.kind, " stableId=", entry.stableId)

View File

@@ -34,8 +34,8 @@ DisplayArea.fromProto = function (proto, isActivityInTree: Boolean): DisplayArea
const entry = new DisplayArea(proto.isTaskDisplayArea, windowContainer)
entry.obj = getWMPropertiesForDisplay(proto)
entry.kind = entry.constructor.name
entry.shortName = shortenName(entry.name)
entry.children = entry.childrenWindows
entry.rawTreeViewObject = asRawTreeViewObject(entry)
console.warn("Created ", entry.kind, " stableId=", entry.stableId)

View File

@@ -62,8 +62,8 @@ DisplayContent.fromProto = function (proto, isActivityInTree: Boolean): DisplayC
)
entry.obj = getWMPropertiesForDisplay(proto)
entry.kind = entry.constructor.name
entry.shortName = shortenName(entry.name)
entry.children = entry.childrenWindows
entry.rawTreeViewObject = asRawTreeViewObject(entry)
console.warn("Created ", entry.kind, " stableId=", entry.stableId)

View File

@@ -61,6 +61,7 @@ WindowContainer.fromProto = function ({
// the properties view of the element as we can always see those elements'
// properties by changing the target element in the hierarchy tree view.
entry.obj = getWMPropertiesForDisplay(proto)
entry.kind = entry.constructor.name
entry.shortName = shortenName(entry.name)
entry.rawTreeViewObject = asRawTreeViewObject(entry)
return entry
@@ -83,7 +84,6 @@ function newConfigurationContainer(proto): ConfigurationContainer {
newConfiguration(proto?.mergedOverrideConfiguration ?? null)
)
entry.kind = "ConfigurationContainer"
entry.obj = entry
return entry
}

View File

@@ -74,15 +74,14 @@ import WindowContainer from "./WindowContainer"
/* isAppWindow */ isActivityInTree
)
entry.rects.map((rect) => rect.ref = entry)
entry.kind = entry.constructor.name
entry.obj = getWMPropertiesForDisplay(proto)
entry.rect = entry.frame
entry.rect.ref = entry
entry.rect.label = entry.name
entry.shortName = shortenName(entry.name)
entry.visible = entry.isVisible ?? false
entry.chips = entry.isVisible ? [VISIBLE_CHIP] : []
entry.children = entry.childrenWindows
if (entry.visible) {
entry.rect = entry.rects[0]
}
entry.rawTreeViewObject = asRawTreeViewObject(entry)
return entry
}

View File

@@ -33,9 +33,9 @@ WindowToken.fromProto = function (proto, isActivityInTree: Boolean): WindowToken
throw "Window container should not be null: " + JSON.stringify(proto)
}
const entry = new WindowToken(windowContainer)
entry.kind = entry.constructor.name
entry.obj = getWMPropertiesForDisplay(proto)
entry.shortName = shortenName(entry.name)
entry.children = entry.childrenWindows
entry.rawTreeViewObject = asRawTreeViewObject(entry)
console.warn("Created ", entry.kind, " stableId=", entry.stableId)