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

Commit bb71cd50 authored by Oleg Blinnikov's avatar Oleg Blinnikov Committed by Android (Google) Code Review
Browse files

Merge "Re-initialize default display on type change" into main

parents 2d8648f7 8fd7533e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1408,6 +1408,7 @@ public class DisplayModeDirector {
        private int mExternalDisplayPeakHeight;
        private int mExternalDisplayPeakRefreshRate;
        private final boolean mRefreshRateSynchronizationEnabled;
        private int mDefaultDisplayType = Display.TYPE_INTERNAL;

        DisplayObserver(Context context, Handler handler, VotesStorage votesStorage,
                Injector injector) {
@@ -1480,6 +1481,9 @@ public class DisplayModeDirector {
            if (displayInfo == null) {
                return;
            }
            if (displayId == Display.DEFAULT_DISPLAY) {
                mDefaultDisplayType = displayInfo.type;
            }
            updateDisplayDeviceConfig(displayId);
            registerExternalDisplay(displayInfo);
            updateDisplayModes(displayId, displayInfo);
@@ -1511,6 +1515,14 @@ public class DisplayModeDirector {
            if (displayInfo == null) {
                return;
            }
            if (displayId == Display.DEFAULT_DISPLAY && displayInfo.type != mDefaultDisplayType) {
                // If the default display's type changes (e.g. from internal to external),
                // treat it as a new display being added to ensure all configurations are
                // re-initialized correctly for the new display type.
                onDisplayRemoved(displayId);
                onDisplayAdded(displayId);
                return;
            }
            updateDisplayDeviceConfig(displayId);
            updateHasArrSupport(displayId, displayInfo);
            updateDisplayModes(displayId, displayInfo);
+202 −122

File changed.

Preview size limit exceeded, changes collapsed.