1/*
2 * Copyright (C) 2017 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
17syntax = "proto2";
18
19import "frameworks/base/core/proto/android/app/statusbarmanager.proto";
20import "frameworks/base/core/proto/android/content/activityinfo.proto";
21import "frameworks/base/core/proto/android/content/configuration.proto";
22import "frameworks/base/core/proto/android/graphics/rect.proto";
23import "frameworks/base/core/proto/android/server/appwindowthumbnail.proto";
24import "frameworks/base/core/proto/android/server/surfaceanimator.proto";
25import "frameworks/base/core/proto/android/view/displaycutout.proto";
26import "frameworks/base/core/proto/android/view/displayinfo.proto";
27import "frameworks/base/core/proto/android/view/surface.proto";
28import "frameworks/base/core/proto/android/view/windowlayoutparams.proto";
29import "frameworks/base/libs/incident/proto/android/privacy.proto";
30
31package com.android.server.wm;
32
33option java_multiple_files = true;
34
35message WindowManagerServiceDumpProto {
36    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
37
38    optional WindowManagerPolicyProto policy = 1;
39    /* window hierarchy root */
40    optional RootWindowContainerProto root_window_container = 2;
41    optional IdentifierProto focused_window = 3;
42    optional string focused_app = 4;
43    optional IdentifierProto input_method_window = 5;
44    optional bool display_frozen = 6;
45    optional int32 rotation = 7;
46    optional int32 last_orientation = 8;
47    optional AppTransitionProto app_transition = 9;
48}
49
50/* represents DisplayContent */
51message RootWindowContainerProto {
52    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
53
54    optional WindowContainerProto window_container = 1;
55    repeated DisplayProto displays = 2;
56    /* window references in top down z order */
57    repeated IdentifierProto windows = 3;
58}
59
60message BarControllerProto {
61    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
62
63    optional .android.app.StatusBarManagerProto.WindowState state = 1;
64    optional .android.app.StatusBarManagerProto.TransientWindowState transient_state = 2;
65}
66
67message WindowOrientationListenerProto {
68    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
69
70    optional bool enabled = 1;
71    optional .android.view.SurfaceProto.Rotation rotation = 2;
72}
73
74message KeyguardServiceDelegateProto {
75    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
76
77    optional bool showing = 1;
78    optional bool occluded = 2;
79    optional bool secure = 3;
80    enum ScreenState {
81        SCREEN_STATE_OFF = 0;
82        SCREEN_STATE_TURNING_ON = 1;
83        SCREEN_STATE_ON = 2;
84        SCREEN_STATE_TURNING_OFF = 3;
85    }
86    optional ScreenState screen_state = 4;
87    enum InteractiveState {
88        INTERACTIVE_STATE_SLEEP = 0;
89        INTERACTIVE_STATE_WAKING = 1;
90        INTERACTIVE_STATE_AWAKE = 2;
91        INTERACTIVE_STATE_GOING_TO_SLEEP = 3;
92    }
93    optional InteractiveState interactive_state = 5;
94}
95
96/* represents PhoneWindowManager */
97message WindowManagerPolicyProto {
98    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
99
100    optional int32 last_system_ui_flags = 1;
101    enum UserRotationMode {
102        USER_ROTATION_FREE = 0;
103        USER_ROTATION_LOCKED = 1;
104    }
105    optional UserRotationMode rotation_mode = 2;
106    optional .android.view.SurfaceProto.Rotation rotation = 3;
107    optional .android.content.ActivityInfoProto.ScreenOrientation orientation = 4;
108    optional bool screen_on_fully = 5;
109    optional bool keyguard_draw_complete = 6;
110    optional bool window_manager_draw_complete = 7;
111    optional string focused_app_token = 8;
112    optional IdentifierProto focused_window = 9;
113    optional IdentifierProto top_fullscreen_opaque_window = 10;
114    optional IdentifierProto top_fullscreen_opaque_or_dimming_window = 11;
115    optional bool keyguard_occluded = 12;
116    optional bool keyguard_occluded_changed = 13;
117    optional bool keyguard_occluded_pending = 14;
118    optional bool force_status_bar = 15;
119    optional bool force_status_bar_from_keyguard = 16;
120    optional BarControllerProto status_bar = 17;
121    optional BarControllerProto navigation_bar = 18;
122    optional WindowOrientationListenerProto orientation_listener = 19;
123    optional KeyguardServiceDelegateProto keyguard_delegate = 20;
124}
125
126/* represents AppTransition */
127message AppTransitionProto {
128    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
129
130    enum AppState {
131        APP_STATE_IDLE = 0;
132        APP_STATE_READY = 1;
133        APP_STATE_RUNNING = 2;
134        APP_STATE_TIMEOUT = 3;
135    }
136    optional AppState app_transition_state = 1;
137    /* definitions for constants found in {@link com.android.server.wm.AppTransition} */
138    enum TransitionType {
139        TRANSIT_NONE = 0;
140        TRANSIT_UNSET = -1;
141        TRANSIT_ACTIVITY_OPEN = 6;
142        TRANSIT_ACTIVITY_CLOSE = 7;
143        TRANSIT_TASK_OPEN = 8;
144        TRANSIT_TASK_CLOSE = 9;
145        TRANSIT_TASK_TO_FRONT = 10;
146        TRANSIT_TASK_TO_BACK = 11;
147        TRANSIT_WALLPAPER_CLOSE = 12;
148        TRANSIT_WALLPAPER_OPEN = 13;
149        TRANSIT_WALLPAPER_INTRA_OPEN = 14;
150        TRANSIT_WALLPAPER_INTRA_CLOSE = 15;
151        TRANSIT_TASK_OPEN_BEHIND = 16;
152        TRANSIT_TASK_IN_PLACE = 17;
153        TRANSIT_ACTIVITY_RELAUNCH = 18;
154        TRANSIT_DOCK_TASK_FROM_RECENTS = 19;
155        TRANSIT_KEYGUARD_GOING_AWAY = 20;
156        TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER = 21;
157        TRANSIT_KEYGUARD_OCCLUDE = 22;
158        TRANSIT_KEYGUARD_UNOCCLUDE = 23;
159        TRANSIT_TRANSLUCENT_ACTIVITY_OPEN = 24;
160        TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE = 25;
161    }
162    optional TransitionType last_used_app_transition = 2;
163}
164
165/* represents DisplayContent */
166message DisplayProto {
167    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
168
169    optional WindowContainerProto window_container = 1;
170    optional int32 id = 2;
171    repeated StackProto stacks = 3;
172    optional DockedStackDividerControllerProto docked_stack_divider_controller = 4;
173    optional PinnedStackControllerProto pinned_stack_controller = 5;
174    /* non app windows */
175    repeated WindowTokenProto above_app_windows = 6;
176    repeated WindowTokenProto below_app_windows = 7;
177    repeated WindowTokenProto ime_windows = 8;
178    optional int32 dpi = 9;
179    optional .android.view.DisplayInfoProto display_info = 10;
180    optional int32 rotation = 11;
181    optional ScreenRotationAnimationProto screen_rotation_animation = 12;
182    optional DisplayFramesProto display_frames = 13;
183}
184
185/* represents DisplayFrames */
186message DisplayFramesProto {
187    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
188
189    optional .android.graphics.RectProto stable_bounds = 1;
190}
191
192/* represents DockedStackDividerController */
193message DockedStackDividerControllerProto {
194    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
195
196    optional bool minimized_dock = 1;
197}
198
199/* represents PinnedStackController */
200message PinnedStackControllerProto {
201    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
202
203    optional .android.graphics.RectProto default_bounds = 1;
204    optional .android.graphics.RectProto movement_bounds = 2;
205}
206
207/* represents TaskStack */
208message StackProto {
209    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
210
211    optional WindowContainerProto window_container = 1;
212    optional int32 id = 2;
213    repeated TaskProto tasks = 3;
214    optional bool fills_parent = 4;
215    optional .android.graphics.RectProto bounds = 5;
216    optional bool animation_background_surface_is_dimming = 6;
217    optional bool defer_removal = 7;
218    optional float minimize_amount = 8;
219    optional bool adjusted_for_ime = 9;
220    optional float adjust_ime_amount = 10;
221    optional float adjust_divider_amount = 11;
222    optional .android.graphics.RectProto adjusted_bounds = 12;
223    optional bool animating_bounds = 13;
224}
225
226/* represents Task */
227message TaskProto {
228    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
229
230    optional WindowContainerProto window_container = 1;
231    optional int32 id = 2;
232    repeated AppWindowTokenProto app_window_tokens = 3;
233    optional bool fills_parent = 4;
234    optional .android.graphics.RectProto bounds = 5;
235    optional .android.graphics.RectProto temp_inset_bounds = 6;
236    optional bool defer_removal = 7;
237}
238
239/* represents AppWindowToken */
240message AppWindowTokenProto {
241    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
242
243    /* obtained from ActivityRecord */
244    optional string name = 1 [ (.android.privacy).dest = DEST_EXPLICIT ];
245    optional WindowTokenProto window_token = 2;
246    optional bool last_surface_showing = 3;
247    optional bool is_waiting_for_transition_start = 4;
248    optional bool is_really_animating = 5;
249    optional AppWindowThumbnailProto thumbnail = 6;
250    optional bool fills_parent = 7;
251    optional bool app_stopped = 8;
252    optional bool hidden_requested = 9;
253    optional bool client_hidden = 10;
254    optional bool defer_hiding_client = 11;
255    optional bool reported_drawn = 12;
256    optional bool reported_visible = 13;
257    optional int32 num_interesting_windows = 14;
258    optional int32 num_drawn_windows = 15;
259    optional bool all_drawn = 16;
260    optional bool last_all_drawn = 17;
261    optional bool removed = 18;
262    optional IdentifierProto starting_window = 19;
263    optional bool starting_displayed = 20;
264    optional bool starting_moved = 21;
265    optional bool hidden_set_from_transferred_starting_window = 22;
266    repeated .android.graphics.RectProto frozen_bounds = 23;
267}
268
269/* represents WindowToken */
270message WindowTokenProto {
271    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
272
273    optional WindowContainerProto window_container = 1;
274    optional int32 hash_code = 2;
275    repeated WindowStateProto windows = 3;
276    optional bool hidden = 4;
277    optional bool waiting_to_show = 5;
278    optional bool paused = 6;
279}
280
281/* represents WindowState */
282message WindowStateProto {
283    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
284
285    optional WindowContainerProto window_container = 1;
286    optional IdentifierProto identifier = 2;
287    optional int32 display_id = 3;
288    optional int32 stack_id = 4;
289    optional .android.view.WindowLayoutParamsProto attributes = 5;
290    optional .android.graphics.RectProto given_content_insets = 6;
291    optional .android.graphics.RectProto frame = 7;
292    optional .android.graphics.RectProto containing_frame = 8;
293    optional .android.graphics.RectProto parent_frame = 9;
294    optional .android.graphics.RectProto content_frame = 10;
295    optional .android.graphics.RectProto content_insets = 11;
296    optional .android.graphics.RectProto surface_insets = 12;
297    optional WindowStateAnimatorProto animator = 13;
298    optional bool animating_exit = 14;
299    repeated WindowStateProto child_windows = 15;
300    optional .android.graphics.RectProto surface_position = 16;
301    optional int32 requested_width = 18;
302    optional int32 requested_height = 19;
303    optional int32 view_visibility = 20;
304    optional int32 system_ui_visibility = 21;
305    optional bool has_surface = 22;
306    optional bool is_ready_for_display = 23;
307    optional .android.graphics.RectProto display_frame = 24;
308    optional .android.graphics.RectProto overscan_frame = 25;
309    optional .android.graphics.RectProto visible_frame = 26;
310    optional .android.graphics.RectProto decor_frame = 27;
311    optional .android.graphics.RectProto outset_frame = 28;
312    optional .android.graphics.RectProto overscan_insets = 29;
313    optional .android.graphics.RectProto visible_insets = 30;
314    optional .android.graphics.RectProto stable_insets = 31;
315    optional .android.graphics.RectProto outsets = 32;
316    optional .android.view.DisplayCutoutProto cutout = 33;
317    optional bool remove_on_exit = 34;
318    optional bool destroying = 35;
319    optional bool removed = 36;
320    optional bool is_on_screen = 37;
321    optional bool is_visible = 38;
322}
323
324message IdentifierProto {
325    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
326
327    optional int32 hash_code = 1;
328    optional int32 user_id = 2;
329    optional string title = 3 [ (.android.privacy).dest = DEST_EXPLICIT ];
330}
331
332/* represents WindowStateAnimator */
333message WindowStateAnimatorProto {
334    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
335
336    optional .android.graphics.RectProto last_clip_rect = 1;
337    optional WindowSurfaceControllerProto surface = 2;
338    enum DrawState {
339        NO_SURFACE = 0;
340        DRAW_PENDING = 1;
341        COMMIT_DRAW_PENDING = 2;
342        READY_TO_SHOW = 3;
343        HAS_DRAWN = 4;
344    }
345    optional DrawState draw_state = 3;
346    optional .android.graphics.RectProto system_decor_rect = 4;
347}
348
349/* represents WindowSurfaceController */
350message WindowSurfaceControllerProto {
351    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
352
353    optional bool shown = 1;
354    optional int32 layer = 2;
355}
356
357/* represents ScreenRotationAnimation */
358message ScreenRotationAnimationProto {
359    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
360
361    optional bool started = 1;
362    optional bool animation_running = 2;
363}
364
365/* represents WindowContainer */
366message WindowContainerProto {
367    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
368
369    optional ConfigurationContainerProto configuration_container = 1;
370    optional int32 orientation = 2;
371    optional bool visible = 3;
372    optional SurfaceAnimatorProto surface_animator = 4;
373}
374
375/* represents ConfigurationContainer */
376message ConfigurationContainerProto {
377    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
378
379    optional .android.content.ConfigurationProto override_configuration = 1;
380    optional .android.content.ConfigurationProto full_configuration = 2;
381    optional .android.content.ConfigurationProto merged_override_configuration = 3;
382}
383