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

Commit d9e15855 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski Committed by Android (Google) Code Review
Browse files

Merge "Do not consider "desktop" displays as fixed orientation" into main

parents 18468bb9 23cbd0ec
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -5735,8 +5735,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    }

    /**
     * This is the development option to force enable desktop mode on all secondary public displays
     * that are not owned by a virtual device.
     * This is the development option to force enable desktop mode on all secondary public displays.
     * When this is enabled, it also force enable system decorations on those displays.
     *
     * If we need a per-display config to enable desktop mode for production, that config should
@@ -5746,9 +5745,16 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        if (!mWmService.mForceDesktopModeOnExternalDisplays || isDefaultDisplay || isPrivate()) {
            return false;
        }
        // Desktop mode is not supported on virtual devices.
        int deviceId = mRootWindowContainer.mTaskSupervisor.getDeviceIdForDisplayId(mDisplayId);
        return deviceId == Context.DEVICE_ID_DEFAULT;
        if (mDwpcHelper != null && !mDwpcHelper.isWindowingModeSupported(WINDOWING_MODE_FREEFORM)) {
            return false;
        }
        // Virtual displays need to explicitly opt in via the system decorations.
        if (mDisplay.getType() == Display.TYPE_VIRTUAL
                && !mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
                && (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) == 0) {
            return false;
        }
        return true;
    }

    /**
+1 −3
Original line number Diff line number Diff line
@@ -429,9 +429,7 @@ public class DisplayRotation {
        final boolean isTv = mContext.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_LEANBACK);
        mDefaultFixedToUserRotation =
                (isCar || isTv || mService.mIsPc
                        || mDisplayContent.isPublicSecondaryDisplayWithDesktopModeForceEnabled()
                        || !mDisplayContent.shouldRotateWithContent())
                (isCar || isTv || mService.mIsPc || !mDisplayContent.shouldRotateWithContent())
                // For debug purposes the next line turns this feature off with:
                // $ adb shell setprop config.override_forced_orient true
                // $ adb shell wm size reset
+3 −1
Original line number Diff line number Diff line
@@ -508,7 +508,9 @@ public class DisplayWindowSettingsTests extends WindowTestsBase {
    public void testShouldShowImeOnDisplayWithinForceDesktopMode() {
        try {
            // Presume display enabled force desktop mode from developer options.
            final DisplayContent dc = createMockSimulatedDisplay();
            final SettingsEntry settingsEntry = new SettingsEntry();
            settingsEntry.mShouldShowSystemDecors = true;
            final DisplayContent dc = createMockSimulatedDisplay(settingsEntry);
            mWm.setForceDesktopModeOnExternalDisplays(true);
            final WindowManagerInternal wmInternal = LocalServices.getService(
                    WindowManagerInternal.class);