commit | 0b7a7d6f04815a1a32b3f623f258727b93ae9a33 | [log] [tgz] |
---|---|---|
author | Charles Chen <charlesccchen@google.com> | Mon Nov 01 14:46:42 2021 +0800 |
committer | Charles Chen <charlesccchen@google.com> | Mon Nov 01 18:02:10 2021 +0800 |
tree | 913118c14de95497dcbb89d11983d5aac09d0497 | |
parent | 9c0537028dc950a947143d5c65fd40027f495e33 [diff] |
Add isEmpty info in SplitInfo Currently SplitInfo callback didn't dispatched if the top Activity is from other process than TaskFragmentOrganizer's. This CL adds a flag isEmpty in SplitInfo to make users know if there may be an Activity from other process even if Activity list is empty. Bug: 202230350 Test: manual - reproducible steps mentioned in bug 202230350 Change-Id: Ie28a4db9fffb2d661592cf43f9316aa0824e4635
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java index 42b4380..20515e7 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
@@ -516,12 +516,8 @@ // Skipping containers that do not have any activities to report. continue; } - ActivityStack primaryContainer = - new ActivityStack( - container.getPrimaryContainer().collectActivities()); - ActivityStack secondaryContainer = - new ActivityStack( - container.getSecondaryContainer().collectActivities()); + ActivityStack primaryContainer = container.getPrimaryContainer().toActivityStack(); + ActivityStack secondaryContainer = container.getSecondaryContainer().toActivityStack(); SplitInfo splitState = new SplitInfo(primaryContainer, secondaryContainer, // Splits that are not showing side-by-side are reported as having 0 split
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java index 54e44a7..80d9c2c 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java
@@ -109,6 +109,10 @@ return allActivities; } + ActivityStack toActivityStack() { + return new ActivityStack(collectActivities(), mInfo.getRunningActivityCount() == 0); + } + void addPendingAppearedActivity(@NonNull Activity pendingAppearedActivity) { mPendingAppearedActivities.add(pendingAppearedActivity); }
diff --git a/libs/WindowManager/Jetpack/window-extensions-release.aar b/libs/WindowManager/Jetpack/window-extensions-release.aar index 4f36c9c..830d13d 100644 --- a/libs/WindowManager/Jetpack/window-extensions-release.aar +++ b/libs/WindowManager/Jetpack/window-extensions-release.aar Binary files differ