SF: Remove *DisplayId::tryCast usage from ScreenCaptureOutput
Work towards DisplayId opaqueness by eliminating call-sites to APIs that
parse the display ID values directly. One such site is
ScreenCaptureOutput.
Replace all calls to *DisplayId::tryCast with local calls to cached
display variant.
Flag: com.android.graphics.surfaceflinger.flags.stable_edid_ids
Bug: 390690584
Test: libcompositionengine_test && libsurfaceflinger_unittest
Change-Id: Ic83a2b2bfa6fc98b1d0fccc60f450d1587c2cc34
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 1114aff..278aa6f 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -876,7 +876,7 @@
std::variant<int32_t, wp<const DisplayDevice>> captureTypeVariant;
// Display ID of the display the result will be on
- std::optional<DisplayId> displayId{std::nullopt};
+ ftl::Optional<DisplayIdVariant> displayIdVariant{std::nullopt};
// If true, transform is inverted from the parent layer snapshot
bool childrenOnly{false};