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

Commit f0d68b4f authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

Remove idle screen config flags

Bug: 407975670
Test: Builds successfully
Flag: EXEMPT flag deletion
Change-Id: I964c42d011c2744f0387a1ddcb2b17fe5e3c63ed
parent d4589335
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -184,10 +184,6 @@ public class DisplayManagerFlags {
            Flags.FLAG_NEW_HDR_BRIGHTNESS_MODIFIER,
            Flags::newHdrBrightnessModifier);

    private final FlagState mIdleScreenConfigInSubscribingLightSensor = new FlagState(
            Flags.FLAG_IDLE_SCREEN_CONFIG_IN_SUBSCRIBING_LIGHT_SENSOR,
            Flags::idleScreenConfigInSubscribingLightSensor);

    private final FlagState mVirtualDisplayLimit =
            new FlagState(
                    Flags.FLAG_VIRTUAL_DISPLAY_LIMIT,
@@ -487,14 +483,6 @@ public class DisplayManagerFlags {
                com.android.internal.R.bool.config_allowNormalBrightnessForDozePolicy);
    }

     /**
      * @return {@code true} if idle timer refresh rate config is accounted for while subscribing to
      * the light sensor
      */
    public boolean isIdleScreenConfigInSubscribingLightSensorEnabled() {
        return mIdleScreenConfigInSubscribingLightSensor.isEnabled();
    }

    /**
      * @return {@code true} if mirroring won't be enabled until boot completes and the user enables
      * the display.
@@ -667,7 +655,6 @@ public class DisplayManagerFlags {
        pw.println(" " + mNewHdrBrightnessModifier);
        pw.println(" " + mVirtualDisplayLimit);
        pw.println(" " + mNormalBrightnessForDozeParameter);
        pw.println(" " + mIdleScreenConfigInSubscribingLightSensor);
        pw.println(" " + mEnableWaitingConfirmationBeforeMirroring);
        pw.println(" " + mEnableBatteryStatsForAllDisplays);
        pw.println(" " + mEnableApplyDisplayChangedDuringDisplayAdded);
+0 −11
Original line number Diff line number Diff line
@@ -322,17 +322,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "idle_screen_config_in_subscribing_light_sensor"
    namespace: "display_manager"
    description: "Account for Idle screen refresh rate configs while subscribing to light sensor"
    bug: "358019330"
    is_fixed_read_only: true
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_waiting_confirmation_before_mirroring"
    namespace: "display_manager"
+2 −4
Original line number Diff line number Diff line
@@ -1855,8 +1855,7 @@ public class DisplayModeDirector {

        private void loadIdleScreenRefreshRateConfigs(DisplayDeviceConfig displayDeviceConfig) {
            synchronized (mLock) {
                if (!mDisplayManagerFlags.isIdleScreenConfigInSubscribingLightSensorEnabled()
                        || displayDeviceConfig == null || displayDeviceConfig
                if (displayDeviceConfig == null || displayDeviceConfig
                        .getIdleScreenRefreshRateTimeoutLuxThresholdPoint().isEmpty()) {
                    // Setting this to null will let surface flinger know that the idle timer is not
                    // configured in the display configs
@@ -2582,8 +2581,7 @@ public class DisplayModeDirector {
        }

        private boolean isIdleScreenRefreshRateConfigDefined() {
            return mDisplayManagerFlags.isIdleScreenConfigInSubscribingLightSensorEnabled()
                    && mIdleScreenRefreshRateTimeoutLuxThresholdPoints != null
            return mIdleScreenRefreshRateTimeoutLuxThresholdPoints != null
                    && !mIdleScreenRefreshRateTimeoutLuxThresholdPoints.isEmpty();
        }

+1 −12
Original line number Diff line number Diff line
@@ -1559,16 +1559,7 @@ public class DisplayModeDirectorTest {
                        getIdleScreenRefreshRateTimeoutLuxThresholdPoint(100, 800)));
        director.defaultDisplayDeviceUpdated(ddcMock); // set the updated ddc

        // idleScreenRefreshRate config is still null because the flag to enable subscription to
        // light sensor is not enabled
        sensorListener.onSensorChanged(TestUtils.createSensorEvent(lightSensor, 4));
        waitForIdleSync();
        assertNull(director.getBrightnessObserver().getIdleScreenRefreshRateConfig());

        // Flag to subscribe to light sensor is enabled, and the sensor subscription is attempted
        // again to load the idle screen refresh rate config
        when(mDisplayManagerFlags.isIdleScreenConfigInSubscribingLightSensorEnabled())
                .thenReturn(true);
        // The sensor subscription is attempted again to load the idle screen refresh rate config
        director.defaultDisplayDeviceUpdated(ddcMock); // set the updated ddc

        // Sensor reads 5 lux
@@ -3298,8 +3289,6 @@ public class DisplayModeDirectorTest {

    @Test
    public void testNotifyDefaultDisplayDeviceUpdated() {
        when(mDisplayManagerFlags.isIdleScreenConfigInSubscribingLightSensorEnabled())
                .thenReturn(true);
        when(mResources.getInteger(com.android.internal.R.integer.config_defaultPeakRefreshRate))
            .thenReturn(75);
        when(mResources.getInteger(R.integer.config_defaultRefreshRate))