Remove HDCP check on external displays
Pixel devices are still enforced, but the check for other devices
is removed to maintain backward compatibility. This needs to be
reverted when HDCP aidl API becomes ready.
This is safe (and unflagged) because it simply restores the
long-tested Android U behavior for non-Pixel devices, while
leaving the Pixel behavior (where mIsHdcpViaNegVsync is already
set to true) unchanged. This also needs to be cherry-picked to
Android 15, where it cannot be flagged.
Flag: EXEMPT bugfix
Bug: 347825589
Test: play DRM protected video with external display connected
Change-Id: Iec423d9b0d127474c734beb8a0d73f9ce780a4e2
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index fd4bd11..86aa887 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3660,7 +3660,12 @@
state.physical = {.id = displayId,
.hwcDisplayId = hwcDisplayId,
.activeMode = std::move(activeMode)};
- state.isSecure = connectionType == ui::DisplayConnectionType::Internal;
+ if (mIsHdcpViaNegVsync) {
+ state.isSecure = connectionType == ui::DisplayConnectionType::Internal;
+ } else {
+ // TODO(b/349703362): Remove this when HDCP aidl API becomes ready
+ state.isSecure = true; // All physical displays are currently considered secure.
+ }
state.isProtected = true;
state.displayName = std::move(info.name);