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

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

Merge "Add flag check before calling the wm api to set the ratio." into main

parents 24e19925 9bb7528f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settingslib.display;

import static android.window.DesktopExperienceFlags.ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS;

import android.content.Context;
import android.content.res.Resources;
import android.hardware.display.DisplayManager;
@@ -417,7 +419,8 @@ public class DisplayDensityUtils {
                    final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
                    // Only set the ratio for external displays as Settings uses
                    // ScreenResolutionFragment to handle density update for internal display.
                    if (info.type == Display.TYPE_EXTERNAL) {
                    if (ENABLE_PERSISTING_DISPLAY_SIZE_FOR_CONNECTED_DISPLAYS.isTrue()
                            && info.type == Display.TYPE_EXTERNAL) {
                        wm.setForcedDisplayDensityRatio(displayId,
                                mFloatValues[index] / mDefaultDensity, userId);
                    } else {