From 5062b341aec284a771afbd0bc72b7fcc1981f7f8 Mon Sep 17 00:00:00 2001 From: Priyanka Date: Mon, 19 Jul 2021 09:51:46 +0000 Subject: [PATCH] Fixed timeline for uploaded trace + dump files. Now when uploading and opening trace and dump files at the same time, the timeline should be fully interactive in Global, Focused and Targeted modes. Timestamps should appear and change as you click along the timeline. Test: Start a trace. Run a dump on another Winscope instance. End the first trace. Download the files from both instances, upload and open them on a separate instance. Check that the timestamp changes when selecting different parts of the timeline in different modes. bottom of Winscope. Bug: b/163105631 Change-Id: I979dfe5eea9937b64f17ab62b2c068fac507ec87 --- tools/winscope/src/Overlay.vue | 9 +++++++-- tools/winscope/src/decode.js | 6 +++--- tools/winscope/src/main.js | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/winscope/src/Overlay.vue b/tools/winscope/src/Overlay.vue index 4bb051e49..0f60280ca 100644 --- a/tools/winscope/src/Overlay.vue +++ b/tools/winscope/src/Overlay.vue @@ -91,7 +91,8 @@ name="navigationStyle" md-dense > - @@ -412,7 +413,11 @@ export default { } if (this.navigationStyle === NAVIGATION_STYLE.FOCUSED) { - return this.focusedFile; + //dumps do not have a timeline, so if scrolling over a dump, show merged timeline + if (this.focusedFile.timeline) { + return this.focusedFile; + } + return this.mergedTimeline; } if (this.navigationStyle === NAVIGATION_STYLE.CUSTOM) { diff --git a/tools/winscope/src/decode.js b/tools/winscope/src/decode.js index 6c95adfd6..953971478 100644 --- a/tools/winscope/src/decode.js +++ b/tools/winscope/src/decode.js @@ -320,7 +320,7 @@ const FILE_DECODERS = { mime: 'application/octet-stream', protoType: SfDumpMessage, transform: SurfaceFlingerDump.fromProto, - timeline: false, + timeline: true, }, }, [FILE_TYPES.WINDOW_MANAGER_DUMP]: { @@ -331,7 +331,7 @@ const FILE_DECODERS = { mime: 'application/octet-stream', protoType: WmDumpMessage, transform: WindowManagerDump.fromProto, - timeline: false, + timeline: true, }, }, [FILE_TYPES.WAYLAND_DUMP]: { @@ -342,7 +342,7 @@ const FILE_DECODERS = { mime: 'application/octet-stream', protoType: WaylandDumpMessage, transform: transform_wl_outputstate, - timeline: false, + timeline: true, }, }, [FILE_TYPES.SCREEN_RECORDING]: { diff --git a/tools/winscope/src/main.js b/tools/winscope/src/main.js index 9c1816505..907e7de0e 100644 --- a/tools/winscope/src/main.js +++ b/tools/winscope/src/main.js @@ -252,6 +252,9 @@ const store = new Vuex.Store({ }, updateTimelineTime(context, timestamp) { for (const file of context.getters.files) { + //dumps do not have a timeline, so only look at files with timelines to update the timestamp + if (!file.timeline) continue; + const type = file.type; const entryIndex = findLastMatchingSorted( file.timeline,