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

Commit 15cfb428 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Add dev option to force desktop mode

When turned on, this will:
- Enable system decorations on external screens
- Enable freeform windowing mode on external displays
- TODO: Show mouse pointer on external display

Bug: 112451761
Test: DisplaySettingsTests
Test: DesktopModePreferenceControllerTest
Test: FreeformWindowsPreferenceControllerTest
Change-Id: If46399b9d6b8faa2a11fbdf8a4bbfef1284147c8
parent ccf59d6f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -9162,6 +9162,13 @@ public final class Settings {
        public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
                = "enable_freeform_support";
        /**
         * Whether to enable experimental desktop mode on secondary displays.
         * @hide
         */
        public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
                "force_desktop_mode_on_external_displays";
       /**
        * Whether user has enabled development settings.
        */
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ message GlobalSettingsProto {
        optional SettingProto enable_freeform_windows_support = 3 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto force_rtl = 4 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto emulate_display_cutout = 5 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto force_desktop_mode_on_external_displays = 6 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Development development = 39;

+1 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ public class SettingsBackupTest {
                    Settings.Global.DESK_DOCK_SOUND,
                    Settings.Global.DESK_UNDOCK_SOUND,
                    Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT,
                    Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
                    Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES,
                    Settings.Global.DEVELOPMENT_FORCE_RTL,
                    Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
+3 −0
Original line number Diff line number Diff line
@@ -481,6 +481,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Global.EMULATE_DISPLAY_CUTOUT,
                GlobalSettingsProto.Development.EMULATE_DISPLAY_CUTOUT);
        dumpSetting(s, p,
                Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
                GlobalSettingsProto.Development.FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS);
        p.end(developmentToken);

        final long deviceToken = p.start(GlobalSettingsProto.DEVICE);
+3 −4
Original line number Diff line number Diff line
@@ -1061,13 +1061,12 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
    }

    /**
     * Checks if system decorations should be shown on this display.
     *
     * @see Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
     */
    boolean supportsSystemDecorations() {
        return mDisplay.supportsSystemDecorations()
                // TODO (b/111363427): Remove this and set the new FLAG_SHOULD_SHOW_LAUNCHER flag
                // (b/114338689) whenever vr 2d display id is set.
                || mDisplayId == mSupervisor.mService.mVr2dDisplayId;
        return mWindowContainerController.supportsSystemDecorations();
    }

    private boolean shouldDestroyContentOnRemove() {
Loading