Loading services/core/java/com/android/server/wm/WindowManagerFlags.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.wm; import com.android.window.flags.Flags; /** * Utility class to read the flags used in the WindowManager server. * * It is not very cheap to read trunk stable flag, so having a centralized place to cache the flag * values in the system server side. * * Flags should be defined in `core.java.android.window.flags` to allow access from client side. * * To override flag: * adb shell device_config put [namespace] [package].[name] [true/false] * adb reboot * * To access in wm: * {@link WindowManagerService#mFlags} * * Notes: * The system may use flags at anytime, so changing flags will only take effect after device * reboot. Otherwise, it may result unexpected behavior, such as broken transition. * When a flag needs to be read from both the server side and the client side, changing the flag * value will result difference in server and client until device reboot. */ class WindowManagerFlags { /* Start Available Flags */ final boolean mSyncWindowConfigUpdateFlag = Flags.syncWindowConfigUpdateFlag(); /* End Available Flags */ } services/core/java/com/android/server/wm/WindowManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -547,6 +547,8 @@ public class WindowManagerService extends IWindowManager.Stub @VisibleForTesting WindowManagerPolicy mPolicy; final WindowManagerFlags mFlags; final IActivityManager mActivityManager; final ActivityManagerInternal mAmInternal; final UserManagerInternal mUmInternal; Loading Loading @@ -1153,6 +1155,7 @@ public class WindowManagerService extends IWindowManager.Stub mGlobalLock = atm.getGlobalLock(); mAtmService = atm; mContext = context; mFlags = new WindowManagerFlags(); mIsPc = mContext.getPackageManager().hasSystemFeature(FEATURE_PC); mAllowBootMessages = showBootMsgs; mLimitedAlphaCompositing = context.getResources().getBoolean( Loading Loading
services/core/java/com/android/server/wm/WindowManagerFlags.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.wm; import com.android.window.flags.Flags; /** * Utility class to read the flags used in the WindowManager server. * * It is not very cheap to read trunk stable flag, so having a centralized place to cache the flag * values in the system server side. * * Flags should be defined in `core.java.android.window.flags` to allow access from client side. * * To override flag: * adb shell device_config put [namespace] [package].[name] [true/false] * adb reboot * * To access in wm: * {@link WindowManagerService#mFlags} * * Notes: * The system may use flags at anytime, so changing flags will only take effect after device * reboot. Otherwise, it may result unexpected behavior, such as broken transition. * When a flag needs to be read from both the server side and the client side, changing the flag * value will result difference in server and client until device reboot. */ class WindowManagerFlags { /* Start Available Flags */ final boolean mSyncWindowConfigUpdateFlag = Flags.syncWindowConfigUpdateFlag(); /* End Available Flags */ }
services/core/java/com/android/server/wm/WindowManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -547,6 +547,8 @@ public class WindowManagerService extends IWindowManager.Stub @VisibleForTesting WindowManagerPolicy mPolicy; final WindowManagerFlags mFlags; final IActivityManager mActivityManager; final ActivityManagerInternal mAmInternal; final UserManagerInternal mUmInternal; Loading Loading @@ -1153,6 +1155,7 @@ public class WindowManagerService extends IWindowManager.Stub mGlobalLock = atm.getGlobalLock(); mAtmService = atm; mContext = context; mFlags = new WindowManagerFlags(); mIsPc = mContext.getPackageManager().hasSystemFeature(FEATURE_PC); mAllowBootMessages = showBootMsgs; mLimitedAlphaCompositing = context.getResources().getBoolean( Loading