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

Commit 94f34f39 authored by Oleg Blinnikov's avatar Oleg Blinnikov
Browse files

Revert "External display limit on ready to enable"

This reverts commit 16680355.

Reason for revert: b/326503021 is still not fixed

Change-Id: I4e1fc681a25d63e4b52733f6ed5872eae246b2ed
parent 7cc283ab
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -5271,13 +5271,5 @@ public final class DisplayManagerService extends SystemService {
        public ExternalDisplayStatsService getExternalDisplayStatsService() {
            return mExternalDisplayStatsService;
        }

        /**
         * Called on external display is ready to be enabled.
         */
        @Override
        public void onExternalDisplayReadyToBeEnabled(int displayId) {
            mDisplayModeDirector.onExternalDisplayReadyToBeEnabled(displayId);
        }
    }
}
+0 −7
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ class ExternalDisplayPolicy {

        @NonNull
        ExternalDisplayStatsService getExternalDisplayStatsService();

        void onExternalDisplayReadyToBeEnabled(int displayId);
    }

    @NonNull
@@ -187,10 +185,6 @@ class ExternalDisplayPolicy {
            return;
        }

        if (enabled) {
            mInjector.onExternalDisplayReadyToBeEnabled(logicalDisplay.getDisplayIdLocked());
        }

        mLogicalDisplayMapper.setDisplayEnabledLocked(logicalDisplay, enabled);
    }

@@ -223,7 +217,6 @@ class ExternalDisplayPolicy {
        if ((Build.IS_ENG || Build.IS_USERDEBUG)
                && SystemProperties.getBoolean(ENABLE_ON_CONNECT, false)) {
            Slog.w(TAG, "External display is enabled by default, bypassing user consent.");
            mInjector.onExternalDisplayReadyToBeEnabled(logicalDisplay.getDisplayIdLocked());
            mInjector.sendExternalDisplayEventLocked(logicalDisplay, EVENT_DISPLAY_CONNECTED);
            return;
        } else {
+2 −14
Original line number Diff line number Diff line
@@ -699,13 +699,6 @@ public class DisplayModeDirector {
        }
    }

    /**
     * Called when external display is ready to be enabled.
     */
    public void onExternalDisplayReadyToBeEnabled(int displayId) {
        mDisplayObserver.onExternalDisplayReadyToBeEnabled(displayId);
    }

    /**
     * Provides access to DisplayDeviceConfig for specific display
     */
@@ -1400,13 +1393,6 @@ public class DisplayModeDirector {
            }
        }


        void onExternalDisplayReadyToBeEnabled(int displayId) {
            DisplayInfo displayInfo = getDisplayInfo(displayId);
            updateDisplaysPeakRefreshRateAndResolution(displayInfo);
            addDisplaysSynchronizedPeakRefreshRate(displayInfo);
        }

        @Override
        public void onDisplayAdded(int displayId) {
            updateDisplayDeviceConfig(displayId);
@@ -1414,6 +1400,8 @@ public class DisplayModeDirector {
            updateDisplayModes(displayId, displayInfo);
            updateLayoutLimitedFrameRate(displayId, displayInfo);
            updateUserSettingDisplayPreferredSize(displayInfo);
            updateDisplaysPeakRefreshRateAndResolution(displayInfo);
            addDisplaysSynchronizedPeakRefreshRate(displayInfo);
        }

        @Override
+0 −4
Original line number Diff line number Diff line
@@ -157,7 +157,6 @@ public class ExternalDisplayPolicyTest {
        verify(mMockedLogicalDisplayMapper, never()).setDisplayEnabledLocked(any(), anyBoolean());
        verify(mMockedDisplayNotificationManager, times(2))
                .onHighTemperatureExternalDisplayNotAllowed();
        verify(mMockedInjector, never()).onExternalDisplayReadyToBeEnabled(anyInt());
    }

    @Test
@@ -168,7 +167,6 @@ public class ExternalDisplayPolicyTest {
        verify(mMockedLogicalDisplayMapper, never()).setDisplayEnabledLocked(any(), anyBoolean());
        verify(mMockedDisplayNotificationManager, never())
                .onHighTemperatureExternalDisplayNotAllowed();
        verify(mMockedInjector, never()).onExternalDisplayReadyToBeEnabled(anyInt());
    }

    @Test
@@ -186,7 +184,6 @@ public class ExternalDisplayPolicyTest {
        // Expected only 1 invocation, upon critical temperature.
        verify(mMockedDisplayNotificationManager).onHighTemperatureExternalDisplayNotAllowed();
        verify(mMockedExternalDisplayStatsService).onDisplayDisabled(eq(EXTERNAL_DISPLAY_ID));
        verify(mMockedInjector, never()).onExternalDisplayReadyToBeEnabled(anyInt());
    }

    @Test
@@ -194,7 +191,6 @@ public class ExternalDisplayPolicyTest {
        mExternalDisplayPolicy.setExternalDisplayEnabledLocked(mMockedLogicalDisplay,
                /*enabled=*/ true);
        assertDisplaySetEnabled(/*enabled=*/ true);
        verify(mMockedInjector).onExternalDisplayReadyToBeEnabled(eq(EXTERNAL_DISPLAY_ID));
    }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -1952,7 +1952,7 @@ public class DisplayModeDirectorTest {
        SparseArray<SparseArray<Vote>> votesByDisplay = new SparseArray<>();
        votesByDisplay.put(DISPLAY_ID_2, votes);

        director.getDisplayObserver().onExternalDisplayReadyToBeEnabled(DISPLAY_ID_2);
        director.getDisplayObserver().onDisplayAdded(DISPLAY_ID_2);
        director.injectVotesByDisplay(votesByDisplay);

        var desiredSpecs = director.getDesiredDisplayModeSpecs(DISPLAY_ID_2);
Loading