From 0e80ea10005524a9bea2ad61cb427ffa1816bc33 Mon Sep 17 00:00:00 2001 From: Priyanka Date: Wed, 18 Aug 2021 14:37:20 +0000 Subject: [PATCH] Add tags and errors to focused/targeted timelines. Extend the tag timeline display from global to specific WM/SF trace timelines. During focused or targeted navigation, the tags/errors should display for their associated trace only. On global navigation, the minimum start and maximum end timestamp for each transition is displayed. In the search bar, under transitions and errors, note that the timestamps displayed as the global start and end. Bug: b/197066003 Test: upload SampleWinscope.zip from bug and test the different navigation types. Change-Id: Id273bf77425c504d943f1ee9716ce2f3ad0ec9c5 --- tools/winscope/src/Overlay.vue | 77 +++++++++++++++++---------- tools/winscope/src/Searchbar.vue | 4 +- tools/winscope/src/mixins/Timeline.js | 10 ++-- tools/winscope/src/utils/consts.js | 1 - 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/tools/winscope/src/Overlay.vue b/tools/winscope/src/Overlay.vue index 35fbfe70e..d098dd4fd 100644 --- a/tools/winscope/src/Overlay.vue +++ b/tools/winscope/src/Overlay.vue @@ -111,12 +111,6 @@ icon="public" desc="Consider all timelines for navigation" /> - = 2 + && this.navigationStyle.split('-')[0] === NAVIGATION_STYLE.TARGETED + ) { return this.$store.state .traces[this.navigationStyle.split('-')[1]]; } @@ -481,7 +471,7 @@ export default { return this.timelineFiles.length > 1; }, flickerMode() { - return this.navigationStyle === NAVIGATION_STYLE.FLICKER; + return this.tags.length>0 || this.errors.length>0; }, }, updated() { @@ -633,10 +623,6 @@ export default { navigationStyleFilter = (f) => true; break; - case NAVIGATION_STYLE.FLICKER: - navigationStyleFilter = (f) => true; - break; - case NAVIGATION_STYLE.FOCUSED: navigationStyleFilter = (f) => f.type === this.focusedFile.type; @@ -661,6 +647,43 @@ export default { this.$store.commit('setNavigationFilesFilter', navigationStyleFilter); }, + updateFlickerMode(style) { + if (style === NAVIGATION_STYLE.GLOBAL || + style === NAVIGATION_STYLE.CUSTOM) { + this.tags = this.presentTags; + this.errors = this.presentErrors; + + } else if (style === NAVIGATION_STYLE.FOCUSED) { + if (this.focusedFile.timeline) { + this.tags = this.getTagTimelineComponents(this.presentTags, this.focusedFile); + this.errors = this.getTagTimelineComponents(this.presentErrors, this.focusedFile); + } + } else if ( + style.split('-').length >= 2 && + style.split('-')[0] === NAVIGATION_STYLE.TARGETED + ) { + const file = this.$store.state.traces[style.split('-')[1]]; + if (file.timeline) { + this.tags = this.getTagTimelineComponents(this.presentTags, file); + this.errors = this.getTagTimelineComponents(this.presentErrors, file); + } + //Unexpected navigation type or no timeline present in file + } else { + console.warn('Unexpected timeline or navigation type; no flicker mode available'); + this.tags = []; + this.errors = []; + } + }, + getTagTimelineComponents(items, file) { + if (file.type===FILE_TYPES.SURFACE_FLINGER_TRACE) { + return items.filter(item => item.layerId !== -1); + } + if (file.type===FILE_TYPES.WINDOW_MANAGER_TRACE) { + return items.filter(item => item.taskId !== -1); + } + // if focused file is not one supported by tags/errors + return []; + }, updateVideoOverlayWidth(width) { this.videoOverlayExtraWidth = width; }, diff --git a/tools/winscope/src/Searchbar.vue b/tools/winscope/src/Searchbar.vue index 9178a5873..1f5fa4e64 100644 --- a/tools/winscope/src/Searchbar.vue +++ b/tools/winscope/src/Searchbar.vue @@ -30,8 +30,8 @@