Fix missing timeline due to unexpected navigation type.

Added fallback to global timeline instead of throwing a error if
navigation type is unexpected.

Bug: b/195738728

Test: Open x20 file winscope-staging-priyankaspatel and select Flicker
mode from navigation options, then open local Winscope and check that
the global timeline still appears after running/uploading a trace.

Change-Id: I9ea336c31fa1f5c752eb4a30f55f08a3ee595811
This commit is contained in:
Priyanka
2021-08-06 12:49:09 +00:00
parent 6c2ff5fcd3
commit a286cf0d50

View File

@@ -388,7 +388,8 @@ export default {
default:
const split = this.navigationStyle.split('-');
if (split[0] !== NAVIGATION_STYLE.TARGETED) {
throw new Error('Unexpected navigation type');
console.warn('Unexpected navigation type; fallback to global');
return 'All timelines';
}
const fileType = split[1];
@@ -410,7 +411,8 @@ export default {
default:
const split = this.navigationStyle.split('-');
if (split[0] !== NAVIGATION_STYLE.TARGETED) {
throw new Error('Unexpected navigation type');
console.warn('Unexpected navigation type; fallback to global');
return 'public';
}
const fileType = split[1];
@@ -441,7 +443,8 @@ export default {
.traces[this.navigationStyle.split('-')[1]];
}
throw new Error('Unexpected Navigation Style');
console.warn('Unexpected navigation type; fallback to global');
return this.mergedTimeline;
},
isCropped() {
return this.crop != null &&
@@ -608,7 +611,9 @@ export default {
default:
const split = this.navigationStyle.split('-');
if (split[0] !== NAVIGATION_STYLE.TARGETED) {
throw new Error('Unexpected navigation type');
console.warn('Unexpected navigation type; fallback to global');
navigationStyleFilter = (f) => true;
break;
}
const fileType = split[1];