From c0312e75b4bee148c948999ed007e03f72d4d4cf Mon Sep 17 00:00:00 2001 From: Yuncheol Heo Date: Thu, 7 Jul 2022 22:05:33 -0700 Subject: [PATCH] Add a test api, TaskInfo#getDisplayId(). - Some CTS needs to filter out Tasks in non-default display. Bug: 235576683 Test: atest android.devicepolicy.cts.LockTaskTest Change-Id: I2faf700fbe18ac8548dd4d405bc1b8092a4db2ff --- core/api/test-current.txt | 1 + core/java/android/app/TaskInfo.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 631f0fbd0b0cf..df8495ce3587f 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -419,6 +419,7 @@ package android.app { public class TaskInfo { method public boolean containsLaunchCookie(@NonNull android.os.IBinder); method @NonNull public android.content.res.Configuration getConfiguration(); + method public int getDisplayId(); method public int getParentTaskId(); method @Nullable public android.app.PictureInPictureParams getPictureInPictureParams(); method @NonNull public android.window.WindowContainerToken getToken(); diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java index b09463e3074b4..a2dc47d44cb9c 100644 --- a/core/java/android/app/TaskInfo.java +++ b/core/java/android/app/TaskInfo.java @@ -426,6 +426,15 @@ public class TaskInfo { return parentTaskId != INVALID_TASK_ID; } + /** + * @return The id of the display this task is associated with. + * @hide + */ + @TestApi + public int getDisplayId() { + return displayId; + } + /** * Returns {@code true} if the parameters that are important for task organizers are equal * between this {@link TaskInfo} and {@param that}.