summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorCharles Chen <charlesccchen@google.com>2021-09-13 05:48:29 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-09-13 05:48:29 +0000
commit2e4d90b82c876df59de223ca8977647b488a38fe (patch)
treef991e7314ca3f6f48bfb5c9d6c2a6e57e02e9f30 /core/java/android
parentcc2ec49eff7b3772d8728c9c1e45b93ca26560f8 (diff)
parent2c452240eac94d72def84a2f8571f8d0bd40f312 (diff)
Merge "Promote #setAdjacentTaskFragment to TestApi" into sc-v2-dev am: 2c452240ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15528180 Change-Id: I5116fe69b2a674d3428c014c91e450340c2207b8
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/window/WindowContainerTransaction.java34
1 files changed, 23 insertions, 11 deletions
diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java
index 387837d82acf..9d6488d7aa14 100644
--- a/core/java/android/window/WindowContainerTransaction.java
+++ b/core/java/android/window/WindowContainerTransaction.java
@@ -512,17 +512,16 @@ public final class WindowContainerTransaction implements Parcelable {
* @param fragmentToken2 client assigned unique token to create TaskFragment with specified
* in {@link TaskFragmentCreationParams#getFragmentToken()}. If it is
* {@code null}, the transaction will reset the adjacent TaskFragment.
- * @hide
*/
@NonNull
public WindowContainerTransaction setAdjacentTaskFragments(
@NonNull IBinder fragmentToken1, @Nullable IBinder fragmentToken2,
- @Nullable TaskFragmentAdjacentOptions options) {
+ @Nullable TaskFragmentAdjacentParams params) {
final HierarchyOp hierarchyOp =
new HierarchyOp.Builder(HierarchyOp.HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS)
.setContainer(fragmentToken1)
.setReparentContainer(fragmentToken2)
- .setLaunchOptions(options != null ? options.toBundle() : null)
+ .setLaunchOptions(params != null ? params.toBundle() : null)
.build();
mHierarchyOps.add(hierarchyOp);
return this;
@@ -1304,9 +1303,8 @@ public final class WindowContainerTransaction implements Parcelable {
/**
* Helper class for building an options Bundle that can be used to set adjacent rules of
* TaskFragments.
- * @hide
*/
- public static class TaskFragmentAdjacentOptions {
+ public static class TaskFragmentAdjacentParams {
private static final String DELAY_PRIMARY_LAST_ACTIVITY_REMOVAL =
"android:transaction.adjacent.option.delay_primary_removal";
private static final String DELAY_SECONDARY_LAST_ACTIVITY_REMOVAL =
@@ -1315,29 +1313,43 @@ public final class WindowContainerTransaction implements Parcelable {
private boolean mDelayPrimaryLastActivityRemoval;
private boolean mDelaySecondaryLastActivityRemoval;
- public TaskFragmentAdjacentOptions() {
+ public TaskFragmentAdjacentParams() {
}
- public TaskFragmentAdjacentOptions(@NonNull Bundle bundle) {
+ public TaskFragmentAdjacentParams(@NonNull Bundle bundle) {
mDelayPrimaryLastActivityRemoval = bundle.getBoolean(
DELAY_PRIMARY_LAST_ACTIVITY_REMOVAL);
mDelaySecondaryLastActivityRemoval = bundle.getBoolean(
DELAY_SECONDARY_LAST_ACTIVITY_REMOVAL);
}
- public void setDelayPrimaryLastActivityRemoval(boolean delay) {
+ /** @see #shouldDelayPrimaryLastActivityRemoval() */
+ public void setShouldDelayPrimaryLastActivityRemoval(boolean delay) {
mDelayPrimaryLastActivityRemoval = delay;
}
- public void setDelaySecondaryLastActivityRemoval(boolean delay) {
+ /** @see #shouldDelaySecondaryLastActivityRemoval() */
+ public void setShouldDelaySecondaryLastActivityRemoval(boolean delay) {
mDelaySecondaryLastActivityRemoval = delay;
}
- public boolean isDelayPrimaryLastActivityRemoval() {
+ /**
+ * Whether to delay the last activity of the primary adjacent TaskFragment being immediately
+ * removed while finishing.
+ * <p>
+ * It is usually set to {@code true} to give organizer an opportunity to perform other
+ * actions or animations. An example is to finish together with the adjacent TaskFragment.
+ * </p>
+ */
+ public boolean shouldDelayPrimaryLastActivityRemoval() {
return mDelayPrimaryLastActivityRemoval;
}
- public boolean isDelaySecondaryLastActivityRemoval() {
+ /**
+ * Similar to {@link #shouldDelayPrimaryLastActivityRemoval()}, but for the secondary
+ * TaskFragment.
+ */
+ public boolean shouldDelaySecondaryLastActivityRemoval() {
return mDelaySecondaryLastActivityRemoval;
}