From c110849433da6dfdccd0d3653de87a7d2f274f4e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 14 Apr 2022 05:54:50 +0000 Subject: [PATCH] WindowManagerService: remove unused support for onlyCore mode The "core apps only" mode of system_server is no longer used, and onlyCore is hard-coded to false. For details, see http://ag/17685636. Remove the corresponding obsolete code from WindowManagerService. Bug: 208476087 Change-Id: Icec64be737709b63c14f0d2a73c9abf6894ce87e --- data/etc/services.core.protolog.json | 12 +++---- .../com/android/server/wm/DisplayContent.java | 3 +- .../server/wm/WindowManagerService.java | 33 ++++++++----------- .../java/com/android/server/SystemServer.java | 3 +- .../server/wm/SystemServicesTestRule.java | 2 +- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json index 9b09616d4630c..8d04dabc80128 100644 --- a/data/etc/services.core.protolog.json +++ b/data/etc/services.core.protolog.json @@ -889,6 +889,12 @@ "group": "WM_SHOW_TRANSACTIONS", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, + "-1256520588": { + "message": "performEnableScreen: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. %s", + "level": "INFO", + "group": "WM_DEBUG_BOOT", + "at": "com\/android\/server\/wm\/WindowManagerService.java" + }, "-1248645819": { "message": "\tAdd container=%s", "level": "DEBUG", @@ -1519,12 +1525,6 @@ "group": "WM_DEBUG_WINDOW_TRANSITIONS", "at": "com\/android\/server\/wm\/TransitionController.java" }, - "-618015844": { - "message": "performEnableScreen: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b mOnlyCore=%b. %s", - "level": "INFO", - "group": "WM_DEBUG_BOOT", - "at": "com\/android\/server\/wm\/WindowManagerService.java" - }, "-597091183": { "message": "Delete TaskDisplayArea uid=%d", "level": "VERBOSE", diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 4660757024095..862e07b989574 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -4454,8 +4454,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp boolean wallpaperEnabled = mWmService.mContext.getResources().getBoolean( com.android.internal.R.bool.config_enableWallpaperService) && mWmService.mContext.getResources().getBoolean( - com.android.internal.R.bool.config_checkWallpaperAtBoot) - && !mWmService.mOnlyCore; + com.android.internal.R.bool.config_checkWallpaperAtBoot); final boolean haveBootMsg = drawnWindowTypes.get(TYPE_BOOT_PROGRESS); final boolean haveApp = drawnWindowTypes.get(TYPE_BASE_APPLICATION); diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 3bc6dbdbf1dd8..b6185f4e7c326 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1052,11 +1052,6 @@ public class WindowManagerService extends IWindowManager.Stub // logical displays. final PossibleDisplayInfoMapper mPossibleDisplayInfoMapper; - // If true, only the core apps and services are being launched because the device - // is in a special boot mode, such as being encrypted or waiting for a decryption password. - // For example, when this flag is true, there will be no wallpaper service. - final boolean mOnlyCore; - static WindowManagerThreadPriorityBooster sThreadPriorityBooster = new WindowManagerThreadPriorityBooster(); @@ -1141,11 +1136,10 @@ public class WindowManagerService extends IWindowManager.Stub } public static WindowManagerService main(final Context context, final InputManagerService im, - final boolean showBootMsgs, final boolean onlyCore, WindowManagerPolicy policy, + final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm) { - return main(context, im, showBootMsgs, onlyCore, policy, atm, - new DisplayWindowSettingsProvider(), SurfaceControl.Transaction::new, - SurfaceControl.Builder::new); + return main(context, im, showBootMsgs, policy, atm, new DisplayWindowSettingsProvider(), + SurfaceControl.Transaction::new, SurfaceControl.Builder::new); } /** @@ -1154,14 +1148,14 @@ public class WindowManagerService extends IWindowManager.Stub */ @VisibleForTesting public static WindowManagerService main(final Context context, final InputManagerService im, - final boolean showBootMsgs, final boolean onlyCore, WindowManagerPolicy policy, - ActivityTaskManagerService atm, DisplayWindowSettingsProvider - displayWindowSettingsProvider, Supplier transactionFactory, + final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm, + DisplayWindowSettingsProvider displayWindowSettingsProvider, + Supplier transactionFactory, Function surfaceControlFactory) { final WindowManagerService[] wms = new WindowManagerService[1]; DisplayThread.getHandler().runWithScissors(() -> - wms[0] = new WindowManagerService(context, im, showBootMsgs, onlyCore, policy, - atm, displayWindowSettingsProvider, transactionFactory, + wms[0] = new WindowManagerService(context, im, showBootMsgs, policy, atm, + displayWindowSettingsProvider, transactionFactory, surfaceControlFactory), 0); return wms[0]; } @@ -1183,9 +1177,9 @@ public class WindowManagerService extends IWindowManager.Stub } private WindowManagerService(Context context, InputManagerService inputManager, - boolean showBootMsgs, boolean onlyCore, WindowManagerPolicy policy, - ActivityTaskManagerService atm, DisplayWindowSettingsProvider - displayWindowSettingsProvider, Supplier transactionFactory, + boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm, + DisplayWindowSettingsProvider displayWindowSettingsProvider, + Supplier transactionFactory, Function surfaceControlFactory) { installLock(this, INDEX_WINDOW); mGlobalLock = atm.getGlobalLock(); @@ -1193,7 +1187,6 @@ public class WindowManagerService extends IWindowManager.Stub mContext = context; mIsPc = mContext.getPackageManager().hasSystemFeature(FEATURE_PC); mAllowBootMessages = showBootMsgs; - mOnlyCore = onlyCore; mLimitedAlphaCompositing = context.getResources().getBoolean( com.android.internal.R.bool.config_sf_limitedAlpha); mHasPermanentDpad = context.getResources().getBoolean( @@ -3651,8 +3644,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: mDisplayEnabled=%b" + " mForceDisplayEnabled=%b" + " mShowingBootMessages=%b" - + " mSystemBooted=%b mOnlyCore=%b. %s", mDisplayEnabled, - mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, mOnlyCore, + + " mSystemBooted=%b. %s", mDisplayEnabled, + mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, new RuntimeException("here").fillInStackTrace()); if (mDisplayEnabled) { return; diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 2f8d10c61f8f6..4cfb479c91875 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1565,8 +1565,7 @@ public final class SystemServer implements Dumpable { // WMS needs sensor service ready mSystemServiceManager.startBootPhase(t, SystemService.PHASE_WAIT_FOR_SENSOR_SERVICE); wm = WindowManagerService.main(context, inputManager, !mFirstBoot, - /* onlyCore= */ false, new PhoneWindowManager(), - mActivityManagerService.mActivityTaskManager); + new PhoneWindowManager(), mActivityManagerService.mActivityTaskManager); ServiceManager.addService(Context.WINDOW_SERVICE, wm, /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PROTO); ServiceManager.addService(Context.INPUT_SERVICE, inputManager, diff --git a/services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java b/services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java index 18c4eb964a3ac..55cc238e17663 100644 --- a/services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java +++ b/services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java @@ -308,7 +308,7 @@ public class SystemServicesTestRule implements TestRule { // Suppress StrictMode violation (DisplayWindowSettings) to avoid log flood. DisplayThread.getHandler().post(StrictMode::allowThreadDiskWritesMask); mWmService = WindowManagerService.main( - mContext, mImService, false, false, wmPolicy, mAtmService, + mContext, mImService, false, wmPolicy, mAtmService, testDisplayWindowSettingsProvider, StubTransaction::new, (unused) -> new MockSurfaceControlBuilder()); spyOn(mWmService);