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

Commit 53eb59be authored by Oleg Petšjonkin's avatar Oleg Petšjonkin Committed by Android (Google) Code Review
Browse files

Merge "Removing enable_vsync_low_light_vote flag" into main

parents b9a22393 59c843f6
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -109,10 +109,6 @@ public class DisplayManagerFlags {
            Flags.FLAG_ENABLE_VSYNC_LOW_POWER_VOTE,
            Flags::enableVsyncLowPowerVote);

    private final FlagState mVsyncLowLightVote = new FlagState(
            Flags.FLAG_ENABLE_VSYNC_LOW_LIGHT_VOTE,
            Flags::enableVsyncLowLightVote);

    private final FlagState mBrightnessWearBedtimeModeClamperFlagState = new FlagState(
            Flags.FLAG_BRIGHTNESS_WEAR_BEDTIME_MODE_CLAMPER,
            Flags::brightnessWearBedtimeModeClamper);
@@ -408,10 +404,6 @@ public class DisplayManagerFlags {
        return mVsyncLowPowerVote.isEnabled();
    }

    public boolean isVsyncLowLightVoteEnabled() {
        return mVsyncLowLightVote.isEnabled();
    }

    public boolean isBrightnessWearBedtimeModeClamperEnabled() {
        return mBrightnessWearBedtimeModeClamperFlagState.isEnabled();
    }
+0 −8
Original line number Diff line number Diff line
@@ -147,14 +147,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "enable_vsync_low_light_vote"
    namespace: "display_manager"
    description: "Feature flag for vsync low light vote"
    bug: "314921657"
    is_fixed_read_only: true
}

flag {
    name: "brightness_wear_bedtime_mode_clamper"
    namespace: "display_manager"
+1 −6
Original line number Diff line number Diff line
@@ -1821,9 +1821,6 @@ public class DisplayModeDirector {
        private final Injector mInjector;
        private final Handler mHandler;


        private final boolean mVsyncLowLightBlockingVoteEnabled;

        private final IThermalEventListener.Stub mThermalListener =
                new IThermalEventListener.Stub() {
                    @Override
@@ -1871,7 +1868,6 @@ public class DisplayModeDirector {
                /* attemptReadFromFeatureParams= */ false);
            mRefreshRateInHighZone = context.getResources().getInteger(
                    R.integer.config_fixedRefreshRateInHighZone);
            mVsyncLowLightBlockingVoteEnabled = flags.isVsyncLowLightVoteEnabled();
            loadIdleScreenRefreshRateConfigs(/* displayDeviceConfig= */ null);
        }

@@ -2313,8 +2309,7 @@ public class DisplayModeDirector {
            synchronized (mLock) {
                config = mDefaultDisplayDeviceConfig;
            }
            return mVsyncLowLightBlockingVoteEnabled
                    && config != null
            return config != null
                    && config.isVrrSupportEnabled()
                    && !config.getRefreshRateData().lowLightBlockingZoneSupportedModes.isEmpty();
        }
+21 −17
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ class BrightnessObserverTest {
    @Test
    fun testLowLightBlockingZoneVotes(@TestParameter testCase: LowLightTestCase) {
        setUpLowBrightnessZone()
        whenever(mockFlags.isVsyncLowLightVoteEnabled).thenReturn(testCase.vsyncLowLightVoteEnabled)
        val displayModeDirector = DisplayModeDirector(
                spyContext, testHandler, mockInjector, mockFlags, mockDisplayDeviceConfigProvider)
        whenever(mockDeviceConfig.isVrrSupportEnabled).thenReturn(testCase.vrrSupported)
@@ -113,21 +112,26 @@ class BrightnessObserverTest {

    enum class LowLightTestCase(
        val vrrSupported: Boolean,
            val vsyncLowLightVoteEnabled: Boolean,
        val refreshRateData: RefreshRateData,
        val refreshRateInLowZone: Int,
        internal val expectedRefreshRateVote: Vote,
        internal val expectedSwitchVote: Vote?,
    ) {
        ALL_ENABLED(true, true, LOW_LIGHT_REFRESH_RATE_DATA, 60,
            EXPECTED_SUPPORTED_MODES_VOTE, null),
        ALL_ENABLED_NO_RR_IN_LOW_ZONE(true, true, LOW_LIGHT_REFRESH_RATE_DATA, 0,
            EXPECTED_SUPPORTED_MODES_VOTE, null),
        VRR_NOT_SUPPORTED(false, true, LOW_LIGHT_REFRESH_RATE_DATA, 60,
            Vote.forPhysicalRefreshRates(60f, 60f), DisableRefreshRateSwitchingVote(true)),
        VSYNC_VOTE_DISABLED(true, false, LOW_LIGHT_REFRESH_RATE_DATA, 50,
            Vote.forPhysicalRefreshRates(50f, 50f), DisableRefreshRateSwitchingVote(true)),
        NO_LOW_LIGHT_CONFIG(true, true, createRefreshRateData(), 40,
            Vote.forPhysicalRefreshRates(40f, 40f), DisableRefreshRateSwitchingVote(true)),
        ALL_ENABLED(
            true, LOW_LIGHT_REFRESH_RATE_DATA, 60,
            EXPECTED_SUPPORTED_MODES_VOTE, null
        ),
        ALL_ENABLED_NO_RR_IN_LOW_ZONE(
            true, LOW_LIGHT_REFRESH_RATE_DATA, 0,
            EXPECTED_SUPPORTED_MODES_VOTE, null
        ),
        VRR_NOT_SUPPORTED(
            false, LOW_LIGHT_REFRESH_RATE_DATA, 60,
            Vote.forPhysicalRefreshRates(60f, 60f), DisableRefreshRateSwitchingVote(true)
        ),
        NO_LOW_LIGHT_CONFIG(
            true, createRefreshRateData(), 40,
            Vote.forPhysicalRefreshRates(40f, 40f), DisableRefreshRateSwitchingVote(true)
        ),
    }
}
 No newline at end of file