Winscope: Use a unique stableId for all layers and wm entries
Top level of the hierarchy contains the entry with a timestamp. When navigating the timeline with arrow keys, entry loses focus since the timestamp changes. See: https://android-window-manager.teams.x20web.corp.google.com/winscope/winscope-staging-vishnun.html Test: Open trace in winscope, click on entry & navigate timeline with arrow keys Merged-In: Ifbd88da717354c66d96a05d25a9d619fa5209e26 Change-Id: Ifbd88da717354c66d96a05d25a9d619fa5209e26
This commit is contained in:
committed by
Nataniel Borges
parent
80ad0baa5b
commit
38ed9eb5d7
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function transform({obj, kind, name, children, timestamp, rect, bounds, highlight, rects_transform, chips, visible, flattened}) {
|
function transform({obj, kind, name, children, timestamp, rect, bounds, highlight, rects_transform, chips, visible, flattened, stableId}) {
|
||||||
function call(fn, arg) {
|
function call(fn, arg) {
|
||||||
return (typeof fn == 'function') ? fn(arg) : fn;
|
return (typeof fn == 'function') ? fn(arg) : fn;
|
||||||
}
|
}
|
||||||
@@ -55,6 +55,9 @@ function transform({obj, kind, name, children, timestamp, rect, bounds, highligh
|
|||||||
var kindResolved = call(kind, obj);
|
var kindResolved = call(kind, obj);
|
||||||
var nameResolved = call(name, obj);
|
var nameResolved = call(name, obj);
|
||||||
var rectResolved = call(rect, obj);
|
var rectResolved = call(rect, obj);
|
||||||
|
var stableIdResolved = (stableId === undefined) ?
|
||||||
|
kindResolved + '|-|' + nameResolved :
|
||||||
|
call(stableId, obj);
|
||||||
|
|
||||||
var result = {
|
var result = {
|
||||||
kind: kindResolved,
|
kind: kindResolved,
|
||||||
@@ -68,7 +71,7 @@ function transform({obj, kind, name, children, timestamp, rect, bounds, highligh
|
|||||||
rects: rects_transform(concat(rectResolved, transformed_children, (e) => e.rects)),
|
rects: rects_transform(concat(rectResolved, transformed_children, (e) => e.rects)),
|
||||||
highlight: call(highlight, obj),
|
highlight: call(highlight, obj),
|
||||||
chips: call(chips, obj),
|
chips: call(chips, obj),
|
||||||
stableId: kindResolved + "|-|" + nameResolved,
|
stableId: stableIdResolved,
|
||||||
visible: call(visible, obj),
|
visible: call(visible, obj),
|
||||||
childrenVisible: transformed_children.some((c) => {
|
childrenVisible: transformed_children.some((c) => {
|
||||||
return c.childrenVisible || c.visible
|
return c.childrenVisible || c.visible
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ function transform_layers_entry(entry) {
|
|||||||
[[entry.layers], transform_layers],
|
[[entry.layers], transform_layers],
|
||||||
],
|
],
|
||||||
timestamp: entry.elapsedRealtimeNanos,
|
timestamp: entry.elapsedRealtimeNanos,
|
||||||
|
stableId: 'entry',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ function transform_entry(entry) {
|
|||||||
[[entry.windowManagerService.policy], transform_policy],
|
[[entry.windowManagerService.policy], transform_policy],
|
||||||
],
|
],
|
||||||
timestamp: entry.elapsedRealtimeNanos,
|
timestamp: entry.elapsedRealtimeNanos,
|
||||||
|
stableId: 'entry',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user