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 @@
diff --git a/tools/winscope/src/mixins/Timeline.js b/tools/winscope/src/mixins/Timeline.js
index 8bd223e83..ec9cde91b 100644
--- a/tools/winscope/src/mixins/Timeline.js
+++ b/tools/winscope/src/mixins/Timeline.js
@@ -149,9 +149,13 @@ export default {
for (const transitionId in groupedTags) {
const id = groupedTags[transitionId];
- //there are two tags per id; check which tag is the start, which is end
- const transitionStartTime = (id[0].isStartTag) ? id[0].timestamp : id[1].timestamp;
- const transitionEndTime = (!id[0].isStartTag) ? id[0].timestamp : id[1].timestamp;
+ //there are at least two tags per id, maybe more if multiple traces
+ // determine which tag is the start (min of start times), which is end (max of end times)
+ const startTimes = id.filter(tag => tag.isStartTag).map(tag => tag.timestamp);
+ const endTimes = id.filter(tag => !tag.isStartTag).map(tag => tag.timestamp);
+
+ const transitionStartTime = Math.min(startTimes);
+ const transitionEndTime = Math.max(endTimes);
//do not freeze new transition, as overlap still to be handled (defaulted to 0)
const transition = this.generateTransition(
diff --git a/tools/winscope/src/utils/consts.js b/tools/winscope/src/utils/consts.js
index 684c1c275..e43a2c1c6 100644
--- a/tools/winscope/src/utils/consts.js
+++ b/tools/winscope/src/utils/consts.js
@@ -31,7 +31,6 @@ const NAVIGATION_STYLE = {
FOCUSED: 'Focused',
CUSTOM: 'Custom',
TARGETED: 'Targeted',
- FLICKER: 'Flicker',
};
const SEARCH_TYPE = {