Enable small dirty detection for variable refresh rate
Bug: 283055450
Test: Build
Change-Id: I670432d6e566260df3cfdc938f4ddbae70b5d47a
diff --git a/device.mk b/device.mk
index 919520b..3a5f147 100644
--- a/device.mk
+++ b/device.mk
@@ -669,6 +669,9 @@
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.display_update_imminent_timeout_ms=50
+# Enhance VRR detection
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.enable_small_dirty_detection=true
+
# force to blend in P3 mode
PRODUCT_PROPERTY_OVERRIDES += \
persist.sys.sf.native_mode=2 \
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index c705b94..fb2d038 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -280,4 +280,17 @@
<!-- Enable variable refresh rate when typing. -->
<bool name="config_variableRefreshRateTypingSupported">true</bool>
+
+ <!-- The list of packages to automatically opt in of fresh rate suppressing by small area
+ detection. Format of this array should be packageName:threshold and threshold value should
+ be between 0 to 1-->
+ <string-array name="config_smallAreaDetectionAllowlist" translatable="false">
+ <!-- Add packages:threshold here -->
+ <item>com.google.android.youtube:0.07</item>
+ <item>com.spotify.music:0.05</item>
+ <item>com.reddit.frontpage:0.07</item>
+ <item>com.zhiliaoapp.musically:0.07</item>
+ <item>com.bilibili.app.in:0.07</item>
+ <item>com.twitter.android:0.07</item>
+ </string-array>
</resources>