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

Commit 567e99ca authored by Ebru Kurnaz's avatar Ebru Kurnaz Committed by Android (Google) Code Review
Browse files

Merge "Update aconfig flag for persisting display size in connected displays" into main

parents 0cf87344 f66580ff
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ public enum DesktopExperienceFlags {
    ENABLE_MOVE_TO_NEXT_DISPLAY_SHORTCUT(Flags::enableMoveToNextDisplayShortcut, false),
    ENABLE_MULTIPLE_DESKTOPS_BACKEND(Flags::enableMultipleDesktopsBackend, false),
    ENABLE_MULTIPLE_DESKTOPS_FRONTEND(Flags::enableMultipleDesktopsFrontend, false),
    ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS(
            Flags::enablePersistingDisplaySizeForConnectedDisplays, false),
    ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY(Flags::enablePerDisplayDesktopWallpaperActivity,
            false),
    ENABLE_PER_DISPLAY_PACKAGE_CONTEXT_CACHE_IN_STATUSBAR_NOTIF(
+2 −5
Original line number Diff line number Diff line
@@ -827,13 +827,10 @@ flag {
}

flag {
    name: "enable_persisting_density_scale_for_connected_displays"
    name: "enable_persisting_display_size_for_connected_displays"
    namespace: "lse_desktop_experience"
    description: "Enables persisting density scale on resolution change for connected displays."
    description: "Enables persisting display size on resolution change for connected displays."
    bug: "392855657"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
+3 −3
Original line number Diff line number Diff line
@@ -155,7 +155,6 @@ import static com.android.server.wm.utils.DisplayInfoOverrides.WM_OVERRIDE_FIELD
import static com.android.server.wm.utils.DisplayInfoOverrides.copyDisplayInfoFields;
import static com.android.server.wm.utils.RegionUtils.forEachRectReverse;
import static com.android.server.wm.utils.RegionUtils.rectListToRegion;
import static com.android.window.flags.Flags.enablePersistingDensityScaleForConnectedDisplays;
import static com.android.window.flags.Flags.enablePresentationForConnectedDisplays;

import android.annotation.IntDef;
@@ -236,6 +235,7 @@ import android.view.WindowManager;
import android.view.WindowManager.DisplayImePolicy;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.view.inputmethod.ImeTracker;
import android.window.DesktopExperienceFlags;
import android.window.DisplayWindowPolicyController;
import android.window.IDisplayAreaOrganizer;
import android.window.ScreenCapture;
@@ -3153,7 +3153,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            }
        }
        // Update the base density if there is a forced density ratio.
        if (enablePersistingDensityScaleForConnectedDisplays()
        if (DesktopExperienceFlags.ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS.isTrue()
                && mIsDensityForced && mExternalDisplayForcedDensityRatio != 0.0f) {
            mBaseDisplayDensity = (int)
                    (mInitialDisplayDensity * mExternalDisplayForcedDensityRatio + 0.5);
@@ -3188,7 +3188,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            density = 0;
        }
        // Save the new density ratio to settings for external displays.
        if (enablePersistingDensityScaleForConnectedDisplays()
        if (DesktopExperienceFlags.ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS.isTrue()
                && mDisplayInfo.type == TYPE_EXTERNAL) {
            mExternalDisplayForcedDensityRatio = (float)
                    mBaseDisplayDensity / getInitialDisplayDensity();
+3 −3
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ import static com.android.server.wm.TransitionSubject.assertThat;
import static com.android.window.flags.Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING;
import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE;
import static com.android.server.display.feature.flags.Flags.FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT;
import static com.android.window.flags.Flags.FLAG_ENABLE_PERSISTING_DENSITY_SCALE_FOR_CONNECTED_DISPLAYS;
import static com.android.window.flags.Flags.FLAG_ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS;

import static com.google.common.truth.Truth.assertThat;

@@ -2925,7 +2925,7 @@ public class DisplayContentTests extends WindowTestsBase {
        assertFalse(dc.mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(dc));
    }

    @EnableFlags(FLAG_ENABLE_PERSISTING_DENSITY_SCALE_FOR_CONNECTED_DISPLAYS)
    @EnableFlags(FLAG_ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS)
    @Test
    public void testForcedDensityRatioSetForExternalDisplays_persistDensityScaleFlagEnabled() {
        final DisplayInfo displayInfo = new DisplayInfo(mDisplayInfo);
@@ -2955,7 +2955,7 @@ public class DisplayContentTests extends WindowTestsBase {
                displayContent.mExternalDisplayForcedDensityRatio, 0.01);
    }

    @EnableFlags(FLAG_ENABLE_PERSISTING_DENSITY_SCALE_FOR_CONNECTED_DISPLAYS)
    @EnableFlags(FLAG_ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS)
    @Test
    public void testForcedDensityUpdateForExternalDisplays_persistDensityScaleFlagEnabled() {
        final DisplayInfo displayInfo = new DisplayInfo(mDisplayInfo);
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ public class DisplayWindowSettingsTests extends WindowTestsBase {
                mSecondaryDisplay.mBaseDisplayDensity);
    }

    @EnableFlags(Flags.FLAG_ENABLE_PERSISTING_DENSITY_SCALE_FOR_CONNECTED_DISPLAYS)
    @EnableFlags(Flags.FLAG_ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS)
    @Test
    public void testSetForcedDensityRatio() {
        mDisplayWindowSettings.setForcedDensity(mSecondaryDisplay.getDisplayInfo(),