xref: /aosp_15_r20/development/tools/winscope/src/trace/trace_info.ts (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
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';
33const SEARCH_ICON = 'search';
34
35interface TraceInfoMap {
36  [key: number]: {
37    name: string;
38    icon: string;
39    color: string;
40    downloadArchiveDir: string;
41    legacyExt: string;
42  };
43}
44
45export const TRACE_INFO: TraceInfoMap = {
46  [TraceType.WINDOW_MANAGER]: {
47    name: 'Window Manager',
48    icon: WINDOW_MANAGER_ICON,
49    color: '#AF5CF7',
50    downloadArchiveDir: 'wm',
51    legacyExt: '.winscope',
52  },
53  [TraceType.SURFACE_FLINGER]: {
54    name: 'Surface Flinger',
55    icon: SURFACE_FLINGER_ICON,
56    color: '#4ECDE6',
57    downloadArchiveDir: 'sf',
58    legacyExt: '.winscope',
59  },
60  [TraceType.SCREEN_RECORDING]: {
61    name: 'Screen Recording',
62    icon: SCREEN_RECORDING_ICON,
63    color: '#8A9CF9',
64    downloadArchiveDir: '',
65    legacyExt: '.mp4',
66  },
67  [TraceType.SCREENSHOT]: {
68    name: 'Screenshot',
69    icon: SCREENSHOT_ICON,
70    color: '#8A9CF9',
71    downloadArchiveDir: '',
72    legacyExt: '.png',
73  },
74  [TraceType.TRANSACTIONS]: {
75    name: 'Transactions',
76    icon: TRANSACTION_ICON,
77    color: '#0D652D',
78    downloadArchiveDir: 'sf',
79    legacyExt: '.winscope',
80  },
81  [TraceType.TRANSACTIONS_LEGACY]: {
82    name: 'Transactions Legacy',
83    icon: TRANSACTION_ICON,
84    color: '#0D652D',
85    downloadArchiveDir: 'sf',
86    legacyExt: '.winscope',
87  },
88  [TraceType.WAYLAND]: {
89    name: 'Wayland',
90    icon: WAYLAND_ICON,
91    color: '#FDC274',
92    downloadArchiveDir: 'wayland',
93    legacyExt: '.winscope',
94  },
95  [TraceType.WAYLAND_DUMP]: {
96    name: 'Wayland Dump',
97    icon: WAYLAND_ICON,
98    color: '#D01884',
99    downloadArchiveDir: 'wayland',
100    legacyExt: '.winscope',
101  },
102  [TraceType.PROTO_LOG]: {
103    name: 'ProtoLog',
104    icon: PROTO_LOG_ICON,
105    color: '#34A853',
106    downloadArchiveDir: 'protolog',
107    legacyExt: '.winscope',
108  },
109  [TraceType.SYSTEM_UI]: {
110    name: 'System UI',
111    icon: SYSTEM_UI_ICON,
112    color: '#7A86FF',
113    downloadArchiveDir: 'sysui',
114    legacyExt: '.winscope',
115  },
116  [TraceType.VIEW_CAPTURE]: {
117    name: 'View Capture',
118    icon: VIEW_CAPTURE_ICON,
119    color: '#59CA77',
120    downloadArchiveDir: 'vc',
121    legacyExt: '.winscope',
122  },
123  [TraceType.INPUT_METHOD_CLIENTS]: {
124    name: 'IME Clients',
125    icon: IME_ICON,
126    color: '#FF964B',
127    downloadArchiveDir: 'ime',
128    legacyExt: '.winscope',
129  },
130  [TraceType.INPUT_METHOD_SERVICE]: {
131    name: 'IME Service',
132    icon: IME_ICON,
133    color: '#FFC24B',
134    downloadArchiveDir: 'ime',
135    legacyExt: '.winscope',
136  },
137  [TraceType.INPUT_METHOD_MANAGER_SERVICE]: {
138    name: 'IME system_server',
139    icon: IME_ICON,
140    color: '#FF6B00',
141    downloadArchiveDir: 'ime',
142    legacyExt: '.winscope',
143  },
144  [TraceType.EVENT_LOG]: {
145    name: 'Event Log',
146    icon: EVENT_LOG_ICON,
147    color: '#fdd663',
148    downloadArchiveDir: 'eventlog',
149    legacyExt: '.winscope',
150  },
151  [TraceType.WM_TRANSITION]: {
152    name: 'WM Transitions',
153    icon: TRANSITION_ICON,
154    color: '#D01884',
155    downloadArchiveDir: 'transition',
156    legacyExt: '.winscope',
157  },
158  [TraceType.SHELL_TRANSITION]: {
159    name: 'Shell Transitions',
160    icon: TRANSITION_ICON,
161    color: '#D01884',
162    downloadArchiveDir: 'transition',
163    legacyExt: '.winscope',
164  },
165  [TraceType.TRANSITION]: {
166    name: 'Transitions',
167    icon: TRANSITION_ICON,
168    color: '#D01884',
169    downloadArchiveDir: 'transition',
170    legacyExt: '.winscope',
171  },
172  [TraceType.CUJS]: {
173    name: 'Jank CUJs',
174    icon: CUJ_ICON,
175    color: '#FF63B8',
176    downloadArchiveDir: 'eventlog',
177    legacyExt: '.winscope',
178  },
179  [TraceType.INPUT_MOTION_EVENT]: {
180    name: 'Motion Events',
181    icon: INPUT_ICON,
182    color: '#8baef4',
183    downloadArchiveDir: 'input',
184    legacyExt: '.winscope',
185  },
186  [TraceType.INPUT_KEY_EVENT]: {
187    name: 'Key Events',
188    icon: INPUT_ICON,
189    color: '#8baef4',
190    downloadArchiveDir: 'input',
191    legacyExt: '.winscope',
192  },
193  [TraceType.INPUT_EVENT_MERGED]: {
194    name: 'Input',
195    icon: INPUT_ICON,
196    color: '#8baef4',
197    downloadArchiveDir: 'input',
198    legacyExt: '.winscope',
199  },
200  [TraceType.SEARCH]: {
201    name: 'Search',
202    icon: SEARCH_ICON,
203    color: '#DEBE13',
204    downloadArchiveDir: '',
205    legacyExt: '',
206  },
207};
208