1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17import {TraceType} from 'trace/trace_type'; 18 19const WINDOW_MANAGER_ICON = 'web'; 20const SURFACE_FLINGER_ICON = 'layers'; 21const SCREEN_RECORDING_ICON = 'videocam'; 22const SCREENSHOT_ICON = 'image'; 23const TRANSACTION_ICON = 'show_chart'; 24const WAYLAND_ICON = 'filter_none'; 25const PROTO_LOG_ICON = 'notes'; 26const SYSTEM_UI_ICON = 'filter_none'; 27const VIEW_CAPTURE_ICON = 'filter_none'; 28const IME_ICON = 'keyboard_alt'; 29const EVENT_LOG_ICON = 'description'; 30const TRANSITION_ICON = 'animation'; 31const CUJ_ICON = 'label'; 32const INPUT_ICON = 'touch_app'; 33 34interface TraceInfoMap { 35 [key: number]: { 36 name: string; 37 icon: string; 38 color: string; 39 downloadArchiveDir: string; 40 legacyExt: string; 41 }; 42} 43 44export const TRACE_INFO: TraceInfoMap = { 45 [TraceType.WINDOW_MANAGER]: { 46 name: 'Window Manager', 47 icon: WINDOW_MANAGER_ICON, 48 color: '#AF5CF7', 49 downloadArchiveDir: 'wm', 50 legacyExt: '.winscope', 51 }, 52 [TraceType.SURFACE_FLINGER]: { 53 name: 'Surface Flinger', 54 icon: SURFACE_FLINGER_ICON, 55 color: '#4ECDE6', 56 downloadArchiveDir: 'sf', 57 legacyExt: '.winscope', 58 }, 59 [TraceType.SCREEN_RECORDING]: { 60 name: 'Screen Recording', 61 icon: SCREEN_RECORDING_ICON, 62 color: '#8A9CF9', 63 downloadArchiveDir: '', 64 legacyExt: '.mp4', 65 }, 66 [TraceType.SCREENSHOT]: { 67 name: 'Screenshot', 68 icon: SCREENSHOT_ICON, 69 color: '#8A9CF9', 70 downloadArchiveDir: '', 71 legacyExt: '.png', 72 }, 73 [TraceType.TRANSACTIONS]: { 74 name: 'Transactions', 75 icon: TRANSACTION_ICON, 76 color: '#5BB974', 77 downloadArchiveDir: 'sf', 78 legacyExt: '.winscope', 79 }, 80 [TraceType.TRANSACTIONS_LEGACY]: { 81 name: 'Transactions Legacy', 82 icon: TRANSACTION_ICON, 83 color: '#5BB974', 84 downloadArchiveDir: 'sf', 85 legacyExt: '.winscope', 86 }, 87 [TraceType.WAYLAND]: { 88 name: 'Wayland', 89 icon: WAYLAND_ICON, 90 color: '#FDC274', 91 downloadArchiveDir: 'wayland', 92 legacyExt: '.winscope', 93 }, 94 [TraceType.WAYLAND_DUMP]: { 95 name: 'Wayland Dump', 96 icon: WAYLAND_ICON, 97 color: '#D01884', 98 downloadArchiveDir: 'wayland', 99 legacyExt: '.winscope', 100 }, 101 [TraceType.PROTO_LOG]: { 102 name: 'ProtoLog', 103 icon: PROTO_LOG_ICON, 104 color: '#40A58A', 105 downloadArchiveDir: 'protolog', 106 legacyExt: '.winscope', 107 }, 108 [TraceType.SYSTEM_UI]: { 109 name: 'System UI', 110 icon: SYSTEM_UI_ICON, 111 color: '#7A86FF', 112 downloadArchiveDir: 'sysui', 113 legacyExt: '.winscope', 114 }, 115 [TraceType.VIEW_CAPTURE]: { 116 name: 'View Capture', 117 icon: VIEW_CAPTURE_ICON, 118 color: '#137333', 119 downloadArchiveDir: 'vc', 120 legacyExt: '.winscope', 121 }, 122 [TraceType.INPUT_METHOD_CLIENTS]: { 123 name: 'IME Clients', 124 icon: IME_ICON, 125 color: '#FA903E', 126 downloadArchiveDir: 'ime', 127 legacyExt: '.winscope', 128 }, 129 [TraceType.INPUT_METHOD_SERVICE]: { 130 name: 'IME Service', 131 icon: IME_ICON, 132 color: '#F29900', 133 downloadArchiveDir: 'ime', 134 legacyExt: '.winscope', 135 }, 136 [TraceType.INPUT_METHOD_MANAGER_SERVICE]: { 137 name: 'IME system_server', 138 icon: IME_ICON, 139 color: '#D93025', 140 downloadArchiveDir: 'ime', 141 legacyExt: '.winscope', 142 }, 143 [TraceType.EVENT_LOG]: { 144 name: 'Event Log', 145 icon: EVENT_LOG_ICON, 146 color: '#fdd663', 147 downloadArchiveDir: 'eventlog', 148 legacyExt: '.winscope', 149 }, 150 [TraceType.WM_TRANSITION]: { 151 name: 'WM Transitions', 152 icon: TRANSITION_ICON, 153 color: '#EC407A', 154 downloadArchiveDir: 'transition', 155 legacyExt: '.winscope', 156 }, 157 [TraceType.SHELL_TRANSITION]: { 158 name: 'Shell Transitions', 159 icon: TRANSITION_ICON, 160 color: '#EC407A', 161 downloadArchiveDir: 'transition', 162 legacyExt: '.winscope', 163 }, 164 [TraceType.TRANSITION]: { 165 name: 'Transitions', 166 icon: TRANSITION_ICON, 167 color: '#EC407A', 168 downloadArchiveDir: 'transition', 169 legacyExt: '.winscope', 170 }, 171 [TraceType.CUJS]: { 172 name: 'Cujs', 173 icon: CUJ_ICON, 174 color: '#EC407A', 175 downloadArchiveDir: 'eventlog', 176 legacyExt: '.winscope', 177 }, 178 [TraceType.INPUT_MOTION_EVENT]: { 179 name: 'Motion Events', 180 icon: INPUT_ICON, 181 color: '#4079ec', 182 downloadArchiveDir: 'input', 183 legacyExt: '.winscope', 184 }, 185 [TraceType.INPUT_KEY_EVENT]: { 186 name: 'Key Events', 187 icon: INPUT_ICON, 188 color: '#4079ec', 189 downloadArchiveDir: 'input', 190 legacyExt: '.winscope', 191 }, 192}; 193