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 {assertDefined} from 'common/assert_utils';
18import {TamperedMessageType} from 'parsers/tampered_message_type';
19import root from 'protos/windowmanager/latest/json';
20
21export const WindowManagerTraceFileProto = TamperedMessageType.tamper(
22  root.lookupType('com.android.server.wm.WindowManagerTraceFileProto'),
23);
24
25export const WindowManagerServiceField = assertDefined(
26  WindowManagerTraceFileProto.fields['entry'].tamperedMessageType,
27).fields['windowManagerService'];
28
29export const RootWindowContainerField = assertDefined(
30  WindowManagerServiceField.tamperedMessageType,
31).fields['rootWindowContainer'];
32
33export const WindowContainerField = assertDefined(
34  RootWindowContainerField.tamperedMessageType,
35).fields['windowContainer'];
36
37export const WindowContainerChildField = assertDefined(
38  WindowContainerField.tamperedMessageType,
39).fields['children'];
40
41export const DisplayContentField = assertDefined(
42  WindowContainerChildField.tamperedMessageType,
43).fields['displayContent'];
44
45export const DisplayAreaField = assertDefined(
46  WindowContainerChildField.tamperedMessageType,
47).fields['displayArea'];
48
49export const TaskField = assertDefined(
50  WindowContainerChildField.tamperedMessageType,
51).fields['task'];
52
53export const ActivityField = assertDefined(
54  WindowContainerChildField.tamperedMessageType,
55).fields['activity'];
56
57export const WindowTokenField = assertDefined(
58  WindowContainerChildField.tamperedMessageType,
59).fields['windowToken'];
60
61export const WindowStateField = assertDefined(
62  WindowContainerChildField.tamperedMessageType,
63).fields['window'];
64
65export const TaskFragmentField = assertDefined(
66  WindowContainerChildField.tamperedMessageType,
67).fields['taskFragment'];
68