Update display mode when setting mAlwaysRespectAppRequest
setShouldAlwaysRespectAppRequestedMode() is called from tests to make
DisplayModeDirector.getDesiredDisplayModeSpecs() to ignore non-app
votes. However, the set boolean will have no effect until something
triggers a call to that getter.
This caused MatchContentFrameRateTest#testMatchContentFramerate_Auto to
fail on devices with a lower-than-max peak_refresh_rate setting (or the
fallback resource config_defaultPeakRefreshRate): its setFrameRate()
call doesn't trigger a call to updateRefreshRateSettingLocked() or any
other vote update, so the lower peak value is still in effect in parts
of the system.
Notify the 'desired specs' listener when changing the bool will allow
the new mAlwaysRespectAppRequest value to properly take effect.
Any multi-refresh-rate device should be able to reproduce like so:
$ adb shell 'settings put system peak_refresh_rate 60'
On userdebug, you can overlay config_defaultPeakRefreshRate instead:
$ adb root
$ adb shell 'settings put system peak_refresh_rate ""' # remove setting
$ adb shell cmd overlay fabricate --target android \
--name DefaultPeak60 \
android:integer/config_defaultPeakRefreshRate 0x10 60
$ adb shell cmd overlay enable com.android.shell:DefaultPeak60
$ adb shell stop
$ adb shell start # so system_server loads the new resource value
$ adb shell cmd overlay lookup android \
android:integer/config_defaultPeakRefreshRate # should output "60"
Bug: 204048977
Test: run cts -m CtsGraphicsTestCases -t android.graphics.cts.MatchContentFrameRateTest#testMatchContentFramerate_Auto
Change-Id: Ic6c2024ab1067ad7ba821190fe05009dac79b929
1 file changed