SF: Flag guard setFrameRate() API
- LayerHistory is now always created
- Do not use LayerHistory when content detection flag is turned off.
Bug: 148428554
Test: atest CtsGraphicsTestCases:SetFrameRateTest
Test: Play YouTube video. When content detection flag is off,
display runs at 90, otherwise at 60.
Test: adb shell /data/.../libsurfaceflinger_unittest
Change-Id: Iab8b79e16a5257c770d9ddd204cfe26d22de83b6
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index ccf5794..8cabcf0 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -248,6 +248,11 @@
static ui::Dataspace wideColorGamutCompositionDataspace;
static ui::PixelFormat wideColorGamutCompositionPixelFormat;
+ // Whether to use frame rate API when deciding about the refresh rate of the display. This
+ // variable is caches in SF, so that we can check it with each layer creation, and a void the
+ // overhead that is caused by reading from sysprop.
+ static bool useFrameRateApi;
+
static char const* getServiceName() ANDROID_API {
return "SurfaceFlinger";
}