1 /*
2  * Copyright (C) 2023 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 
17 package com.android.server.wm;
18 
19 import com.android.window.flags.Flags;
20 
21 /**
22  * Utility class to read the flags used in the WindowManager server.
23  *
24  * It is not very cheap to read trunk stable flag, so having a centralized place to cache the flag
25  * values in the system server side.
26  *
27  * Flags should be defined in `core.java.android.window.flags` to allow access from client side.
28  *
29  * To override flag:
30  *   adb shell device_config put [namespace] [package].[name] [true/false]
31  *   adb reboot
32  *
33  * To access in wm:
34  *   {@link WindowManagerService#mFlags}
35  *
36  * Notes:
37  *   The system may use flags at anytime, so changing flags will only take effect after device
38  *   reboot. Otherwise, it may result unexpected behavior, such as broken transition.
39  *   When a flag needs to be read from both the server side and the client side, changing the flag
40  *   value will result difference in server and client until device reboot.
41  */
42 class WindowManagerFlags {
43 
44     /* Start Available Flags */
45 
46     final boolean mWallpaperOffsetAsync = Flags.wallpaperOffsetAsync();
47 
48     final boolean mAllowsScreenSizeDecoupledFromStatusBarAndCutout =
49             Flags.allowsScreenSizeDecoupledFromStatusBarAndCutout();
50 
51     final boolean mInsetsDecoupledConfiguration = Flags.insetsDecoupledConfiguration();
52 
53     /* End Available Flags */
54 }
55