diff options
| author | Jerry Chang <chenghsiuchang@google.com> | 2020-10-15 11:41:50 +0800 |
|---|---|---|
| committer | Jerry Chang <chenghsiuchang@google.com> | 2020-10-29 16:20:19 +0800 |
| commit | e6fc6a3c2a086c6d02a842e68993e2c4351f07bd (patch) | |
| tree | 84cf8f5fb9093d601e12b06c820bfa58efe2e8f3 /core/java | |
| parent | ec8173509a2a1f500b46cc2c4fc80a166478ae5e (diff) | |
Allow children task of created-by-organizer task to be organized
Allows to organize direct child of root task created by organizer and
extends TaskInfo to reveal the parent task id.
To organize child task properly for each features, passes all child
task organizer events to the listener listening to its parent task if
feasible.
Fix: 169267298
Fix: 169266482
Test: atest WindowOrganizerTests
Test: atest SplitScreenTests
Test: atest PinnedStackTests
Test: atest WindowInsetPolicyTests
Test: atest WMShellUnitTests
Test: split screen works
Change-Id: I8e66f810c86fcdac3287adfa208d8e34786fc9b5
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/TaskInfo.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java index 5caf3057c840..338973ff825e 100644 --- a/core/java/android/app/TaskInfo.java +++ b/core/java/android/app/TaskInfo.java @@ -16,6 +16,8 @@ package android.app; +import static android.app.ActivityTaskManager.INVALID_TASK_ID; + import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; @@ -203,6 +205,13 @@ public class TaskInfo { */ public ArrayList<IBinder> launchCookies = new ArrayList<>(); + /** + * The identifier of the parent task that is created by organizer, otherwise + * {@link ActivityTaskManager#INVALID_TASK_ID}. + * @hide + */ + public int parentTaskId; + TaskInfo() { // Do nothing } @@ -245,6 +254,12 @@ public class TaskInfo { launchCookies.add(cookie); } + /** @hide */ + @TestApi + public boolean hasParentTask() { + return parentTaskId != INVALID_TASK_ID; + } + /** * Reads the TaskInfo from a parcel. */ @@ -275,6 +290,7 @@ public class TaskInfo { source.readBinderList(launchCookies); letterboxActivityBounds = source.readTypedObject(Rect.CREATOR); positionInParent = source.readTypedObject(Point.CREATOR); + parentTaskId = source.readInt(); } /** @@ -308,6 +324,7 @@ public class TaskInfo { dest.writeBinderList(launchCookies); dest.writeTypedObject(letterboxActivityBounds, flags); dest.writeTypedObject(positionInParent, flags); + dest.writeInt(parentTaskId); } @Override @@ -330,6 +347,7 @@ public class TaskInfo { + " launchCookies" + launchCookies + " letterboxActivityBounds=" + letterboxActivityBounds + " positionInParent=" + positionInParent + + " parentTaskId: " + parentTaskId + "}"; } } |
