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