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:
@@ -28,7 +28,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
summarizer(item) {
|
summarizer(item) {
|
||||||
return null;
|
const summary = [];
|
||||||
|
|
||||||
|
if (item.obj.isIncompleteReason) {
|
||||||
|
summary.push({key: 'Incomplete state reason', value: item.obj.isIncompleteReason});
|
||||||
|
}
|
||||||
|
|
||||||
|
return summary;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ WindowManagerState.fromProto = function ({proto, timestamp = 0, where = ""}): Wi
|
|||||||
timestamp = timestamp
|
timestamp = timestamp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
|
entry.rects = entry.windowStates.reverse().map(it => it.rect)
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
entry.obj["isComplete"] = entry.isComplete()
|
entry.obj["isComplete"] = entry.isComplete()
|
||||||
if (!entry.obj.isComplete) {
|
if (!entry.obj.isComplete) {
|
||||||
entry.obj["isIncompleteReason"] = entry.getIsIncompleteReason()
|
entry.obj["isIncompleteReason"] = entry.getIsIncompleteReason()
|
||||||
}
|
}
|
||||||
entry.name = nanosToString(entry.timestamp, TimeUnits.MILLI_SECONDS)
|
|
||||||
entry.shortName = entry.name
|
entry.shortName = entry.name
|
||||||
entry.children = entry.root.childrenWindows.reverse()
|
|
||||||
entry.chips = []
|
entry.chips = []
|
||||||
entry.visible = true
|
entry.visible = true
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ Activity.fromProto = function (proto): Activity {
|
|||||||
)
|
)
|
||||||
|
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|
||||||
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ ActivityTask.fromProto = function (proto, isActivityInTree: Boolean): ActivityTa
|
|||||||
)
|
)
|
||||||
|
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|
||||||
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ DisplayArea.fromProto = function (proto, isActivityInTree: Boolean): DisplayArea
|
|||||||
const entry = new DisplayArea(proto.isTaskDisplayArea, windowContainer)
|
const entry = new DisplayArea(proto.isTaskDisplayArea, windowContainer)
|
||||||
|
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|
||||||
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ DisplayContent.fromProto = function (proto, isActivityInTree: Boolean): DisplayC
|
|||||||
)
|
)
|
||||||
|
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|
||||||
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ WindowContainer.fromProto = function ({
|
|||||||
// the properties view of the element as we can always see those elements'
|
// the properties view of the element as we can always see those elements'
|
||||||
// properties by changing the target element in the hierarchy tree view.
|
// properties by changing the target element in the hierarchy tree view.
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
return entry
|
return entry
|
||||||
@@ -83,7 +84,6 @@ function newConfigurationContainer(proto): ConfigurationContainer {
|
|||||||
newConfiguration(proto?.mergedOverrideConfiguration ?? null)
|
newConfiguration(proto?.mergedOverrideConfiguration ?? null)
|
||||||
)
|
)
|
||||||
|
|
||||||
entry.kind = "ConfigurationContainer"
|
|
||||||
entry.obj = entry
|
entry.obj = entry
|
||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,15 +74,14 @@ import WindowContainer from "./WindowContainer"
|
|||||||
/* isAppWindow */ isActivityInTree
|
/* isAppWindow */ isActivityInTree
|
||||||
)
|
)
|
||||||
|
|
||||||
entry.rects.map((rect) => rect.ref = entry)
|
entry.kind = entry.constructor.name
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
|
entry.rect = entry.frame
|
||||||
|
entry.rect.ref = entry
|
||||||
|
entry.rect.label = entry.name
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.visible = entry.isVisible ?? false
|
entry.visible = entry.isVisible ?? false
|
||||||
entry.chips = entry.isVisible ? [VISIBLE_CHIP] : []
|
entry.chips = entry.isVisible ? [VISIBLE_CHIP] : []
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
if (entry.visible) {
|
|
||||||
entry.rect = entry.rects[0]
|
|
||||||
}
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ WindowToken.fromProto = function (proto, isActivityInTree: Boolean): WindowToken
|
|||||||
throw "Window container should not be null: " + JSON.stringify(proto)
|
throw "Window container should not be null: " + JSON.stringify(proto)
|
||||||
}
|
}
|
||||||
const entry = new WindowToken(windowContainer)
|
const entry = new WindowToken(windowContainer)
|
||||||
|
entry.kind = entry.constructor.name
|
||||||
entry.obj = getWMPropertiesForDisplay(proto)
|
entry.obj = getWMPropertiesForDisplay(proto)
|
||||||
entry.shortName = shortenName(entry.name)
|
entry.shortName = shortenName(entry.name)
|
||||||
entry.children = entry.childrenWindows
|
|
||||||
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
entry.rawTreeViewObject = asRawTreeViewObject(entry)
|
||||||
|
|
||||||
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
console.warn("Created ", entry.kind, " stableId=", entry.stableId)
|
||||||
|
|||||||
Reference in New Issue
Block a user