xref: /aosp_15_r20/development/tools/winscope/src/parsers/window_manager/eager_properties.ts (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1/*
2 * Copyright (C) 2024 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 {ProtoType} from './proto_type';
18
19const commonEagerProperties = ['identifier', 'id', 'name'];
20
21export const EAGER_PROPERTIES = new Map<ProtoType, string[]>([
22  [
23    ProtoType.WindowManagerService,
24    commonEagerProperties.concat([
25      'focusedApp',
26      'focusedWindow',
27      'focusedDisplayId',
28    ]),
29  ],
30  [ProtoType.RootWindowContainer, commonEagerProperties.concat('focusedApp')],
31  [ProtoType.WindowContainer, commonEagerProperties.concat(['visible'])],
32  [
33    ProtoType.DisplayContent,
34    commonEagerProperties.concat([
35      'resumedActivity',
36      'displayInfo',
37      'inputMethodControlTarget',
38      'inputMethodInputTarget',
39      'inputMethodTarget',
40      'imeInsetsSourceProvider',
41      'windowContainer',
42      'focusedApp',
43    ]),
44  ],
45  [ProtoType.DisplayArea, commonEagerProperties],
46  [
47    ProtoType.Task,
48    commonEagerProperties.concat([
49      'displayId',
50      'rootTaskId',
51      'createdByOrganizer',
52    ]),
53  ],
54  [ProtoType.Activity, commonEagerProperties.concat(['state', 'visible'])],
55  [ProtoType.WindowToken, commonEagerProperties],
56  [
57    ProtoType.WindowState,
58    commonEagerProperties.concat([
59      'isVisible',
60      'windowFrames',
61      'containingFrame',
62      'parentFrame',
63      'displayId',
64      'frame',
65      'attributes',
66      'alpha',
67      'animatingExit',
68    ]),
69  ],
70  [ProtoType.TaskFragment, commonEagerProperties.concat(['displayId'])],
71]);
72