Each Display Mode now has a list of supported HDR types.
SurfaceFlinger removes Dolby Vision as a supported HDR type when a certain mode does not support it

Bug: 241349060
Test: atest ExcludeDolbyVisionTest
Change-Id: I481cc13417f65cbcb1f4658be410adb6e99c760b
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 1e43700..aaa2102 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -2330,6 +2330,9 @@
             outMode.sfVsyncOffset = mode.sfVsyncOffset;
             outMode.presentationDeadline = mode.presentationDeadline;
             outMode.group = mode.group;
+            std::transform(mode.supportedHdrTypes.begin(), mode.supportedHdrTypes.end(),
+                           std::back_inserter(outMode.supportedHdrTypes),
+                           [](const int32_t& value) { return static_cast<ui::Hdr>(value); });
             outInfo->supportedDisplayModes.push_back(outMode);
         }
 
diff --git a/libs/gui/aidl/android/gui/DisplayMode.aidl b/libs/gui/aidl/android/gui/DisplayMode.aidl
index 3cd77f8..ce30426 100644
--- a/libs/gui/aidl/android/gui/DisplayMode.aidl
+++ b/libs/gui/aidl/android/gui/DisplayMode.aidl
@@ -27,6 +27,7 @@
     Size resolution;
     float xDpi = 0.0f;
     float yDpi = 0.0f;
+    int[] supportedHdrTypes;
 
     float refreshRate = 0.0f;
     long appVsyncOffset = 0;