diff --git a/services/core/java/com/android/server/AxPcModeService.java b/services/core/java/com/android/server/AxPcModeService.java index 6a36fb726b7e2..a536dd02fa63f 100644 --- a/services/core/java/com/android/server/AxPcModeService.java +++ b/services/core/java/com/android/server/AxPcModeService.java @@ -647,6 +647,16 @@ public void onDisplayAdded(int displayId) { + " uniqueId=" + info.uniqueId); return; } + if (info != null + && (info.ownerPackageName != null + || info.type == Display.TYPE_VIRTUAL + || info.type == Display.TYPE_OVERLAY)) { + Slog.d(TAG, "Ignoring non-external/app-owned display " + displayId + + " type=" + info.type + + " owner=" + info.ownerPackageName + + " uniqueId=" + info.uniqueId); + return; + } } mHandler.post(() -> { setTargetDisplayId(displayId);