Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1108494 authored by Eric Biggers's avatar Eric Biggers
Browse files

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
parent b6cf012f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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",
+1 −2
Original line number Diff line number Diff line
@@ -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);
+13 −20
Original line number Diff line number Diff line
@@ -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<SurfaceControl.Transaction> transactionFactory,
            final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm,
            DisplayWindowSettingsProvider displayWindowSettingsProvider,
            Supplier<SurfaceControl.Transaction> transactionFactory,
            Function<SurfaceSession, SurfaceControl.Builder> 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<SurfaceControl.Transaction> transactionFactory,
            boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm,
            DisplayWindowSettingsProvider displayWindowSettingsProvider,
            Supplier<SurfaceControl.Transaction> transactionFactory,
            Function<SurfaceSession, SurfaceControl.Builder> 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;
+1 −2
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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);