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

Commit da024ac7 authored by Rupesh Bansal's avatar Rupesh Bansal Committed by Android (Google) Code Review
Browse files

Merge "Remove idle screen config flags" into main

parents af05fa7c f0d68b4f
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -179,10 +179,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,
@@ -483,14 +479,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.
@@ -666,7 +654,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
@@ -311,17 +311,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
@@ -1866,8 +1866,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
@@ -2589,8 +2588,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
@@ -1607,16 +1607,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
@@ -3346,8 +3337,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))