From 117a5d9375f0dfd15ce63acbc04bc62470b15719 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 9 Mar 2023 18:16:46 -0600 Subject: [PATCH] Add isTrustedOverlay field to WindowInfo Bug: 263311858 Test: n/a, adds field for use in tests Change-Id: I638f170ebe00e084528983e1b8455af6d14faa05 --- core/api/test-current.txt | 1 + .../android/window/WindowInfosListenerForTest.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 14c53d100d4fb..1113508e780b1 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -3987,6 +3987,7 @@ package android.window { public static class WindowInfosListenerForTest.WindowInfo { field @NonNull public final android.graphics.Rect bounds; + field public final boolean isTrustedOverlay; field @NonNull public final String name; field @NonNull public final android.os.IBinder windowToken; } diff --git a/core/java/android/window/WindowInfosListenerForTest.java b/core/java/android/window/WindowInfosListenerForTest.java index 429156fb980a3..01e577fc5c6af 100644 --- a/core/java/android/window/WindowInfosListenerForTest.java +++ b/core/java/android/window/WindowInfosListenerForTest.java @@ -63,10 +63,17 @@ public class WindowInfosListenerForTest { @NonNull public final Rect bounds; - WindowInfo(@NonNull IBinder windowToken, @NonNull String name, @NonNull Rect bounds) { + /** + * True if the window is a trusted overlay. + */ + public final boolean isTrustedOverlay; + + WindowInfo(@NonNull IBinder windowToken, @NonNull String name, @NonNull Rect bounds, + int inputConfig) { this.windowToken = windowToken; this.name = name; this.bounds = bounds; + this.isTrustedOverlay = (inputConfig & InputConfig.TRUSTED_OVERLAY) != 0; } } @@ -129,7 +136,8 @@ public class WindowInfosListenerForTest { } var bounds = new Rect(handle.frameLeft, handle.frameTop, handle.frameRight, handle.frameBottom); - windowInfos.add(new WindowInfo(handle.getWindowToken(), handle.name, bounds)); + windowInfos.add(new WindowInfo(handle.getWindowToken(), handle.name, bounds, + handle.inputConfig)); } return windowInfos; }