Merge "Promote TaskFragment APIs to TestAPi" into sc-v2-dev am: a2dd624950
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15255747 Change-Id: I6f63fdf388550a15ab8ae69fc0c5dc93cf65ffca
This commit is contained in:
@@ -3202,6 +3202,59 @@ package android.window {
|
|||||||
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskAppearedInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskAppearedInfo> CREATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class TaskFragmentAppearedInfo implements android.os.Parcelable {
|
||||||
|
method @NonNull public android.view.SurfaceControl getLeash();
|
||||||
|
method @NonNull public android.window.TaskFragmentInfo getTaskFragmentInfo();
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskFragmentAppearedInfo> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class TaskFragmentCreationParams implements android.os.Parcelable {
|
||||||
|
method @NonNull public android.os.IBinder getFragmentToken();
|
||||||
|
method @NonNull public android.graphics.Rect getInitialBounds();
|
||||||
|
method @NonNull public android.window.TaskFragmentOrganizerToken getOrganizer();
|
||||||
|
method @NonNull public android.os.IBinder getOwnerToken();
|
||||||
|
method public int getWindowingMode();
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskFragmentCreationParams> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class TaskFragmentCreationParams.Builder {
|
||||||
|
ctor public TaskFragmentCreationParams.Builder(@NonNull android.window.TaskFragmentOrganizerToken, @NonNull android.os.IBinder, @NonNull android.os.IBinder);
|
||||||
|
method @NonNull public android.window.TaskFragmentCreationParams build();
|
||||||
|
method @NonNull public android.window.TaskFragmentCreationParams.Builder setInitialBounds(@NonNull android.graphics.Rect);
|
||||||
|
method @NonNull public android.window.TaskFragmentCreationParams.Builder setWindowingMode(int);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class TaskFragmentInfo implements android.os.Parcelable {
|
||||||
|
method public boolean equalsForTaskFragmentOrganizer(@Nullable android.window.TaskFragmentInfo);
|
||||||
|
method @NonNull public java.util.List<android.os.IBinder> getActivities();
|
||||||
|
method @NonNull public android.content.res.Configuration getConfiguration();
|
||||||
|
method @NonNull public android.os.IBinder getFragmentToken();
|
||||||
|
method @NonNull public android.graphics.Point getPositionInParent();
|
||||||
|
method @NonNull public android.window.WindowContainerToken getToken();
|
||||||
|
method public int getWindowingMode();
|
||||||
|
method public boolean hasRunningActivity();
|
||||||
|
method public boolean isEmpty();
|
||||||
|
method public boolean isVisible();
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskFragmentInfo> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TaskFragmentOrganizer extends android.window.WindowOrganizer {
|
||||||
|
ctor public TaskFragmentOrganizer(@NonNull java.util.concurrent.Executor);
|
||||||
|
method @NonNull public java.util.concurrent.Executor getExecutor();
|
||||||
|
method @NonNull public android.window.TaskFragmentOrganizerToken getOrganizerToken();
|
||||||
|
method public void onTaskFragmentAppeared(@NonNull android.window.TaskFragmentAppearedInfo);
|
||||||
|
method public void onTaskFragmentError(@NonNull android.os.IBinder, @NonNull Throwable);
|
||||||
|
method public void onTaskFragmentInfoChanged(@NonNull android.window.TaskFragmentInfo);
|
||||||
|
method public void onTaskFragmentParentInfoChanged(@NonNull android.os.IBinder, @NonNull android.content.res.Configuration);
|
||||||
|
method public void onTaskFragmentVanished(@NonNull android.window.TaskFragmentInfo);
|
||||||
|
method @CallSuper public void registerOrganizer();
|
||||||
|
method @CallSuper public void unregisterOrganizer();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class TaskFragmentOrganizerToken implements android.os.Parcelable {
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.TaskFragmentOrganizerToken> CREATOR;
|
||||||
|
}
|
||||||
|
|
||||||
public class TaskOrganizer extends android.window.WindowOrganizer {
|
public class TaskOrganizer extends android.window.WindowOrganizer {
|
||||||
ctor public TaskOrganizer();
|
ctor public TaskOrganizer();
|
||||||
method @BinderThread public void addStartingWindow(@NonNull android.window.StartingWindowInfo, @NonNull android.os.IBinder);
|
method @BinderThread public void addStartingWindow(@NonNull android.window.StartingWindowInfo, @NonNull android.os.IBinder);
|
||||||
@@ -3230,9 +3283,13 @@ package android.window {
|
|||||||
|
|
||||||
public final class WindowContainerTransaction implements android.os.Parcelable {
|
public final class WindowContainerTransaction implements android.os.Parcelable {
|
||||||
ctor public WindowContainerTransaction();
|
ctor public WindowContainerTransaction();
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction createTaskFragment(@NonNull android.window.TaskFragmentCreationParams);
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction deleteTaskFragment(@NonNull android.window.WindowContainerToken);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method @NonNull public android.window.WindowContainerTransaction reorder(@NonNull android.window.WindowContainerToken, boolean);
|
method @NonNull public android.window.WindowContainerTransaction reorder(@NonNull android.window.WindowContainerToken, boolean);
|
||||||
method @NonNull public android.window.WindowContainerTransaction reparent(@NonNull android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, boolean);
|
method @NonNull public android.window.WindowContainerTransaction reparent(@NonNull android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, boolean);
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction reparentActivityToTaskFragment(@NonNull android.os.IBinder, @NonNull android.os.IBinder);
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction reparentChildren(@NonNull android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken);
|
||||||
method @NonNull public android.window.WindowContainerTransaction reparentTasks(@Nullable android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, @Nullable int[], @Nullable int[], boolean);
|
method @NonNull public android.window.WindowContainerTransaction reparentTasks(@Nullable android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, @Nullable int[], @Nullable int[], boolean);
|
||||||
method @NonNull public android.window.WindowContainerTransaction scheduleFinishEnterPip(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
method @NonNull public android.window.WindowContainerTransaction scheduleFinishEnterPip(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setActivityWindowingMode(@NonNull android.window.WindowContainerToken, int);
|
method @NonNull public android.window.WindowContainerTransaction setActivityWindowingMode(@NonNull android.window.WindowContainerToken, int);
|
||||||
@@ -3240,12 +3297,14 @@ package android.window {
|
|||||||
method @NonNull public android.window.WindowContainerTransaction setAppBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
method @NonNull public android.window.WindowContainerTransaction setAppBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
method @NonNull public android.window.WindowContainerTransaction setBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setBoundsChangeTransaction(@NonNull android.window.WindowContainerToken, @NonNull android.view.SurfaceControl.Transaction);
|
method @NonNull public android.window.WindowContainerTransaction setBoundsChangeTransaction(@NonNull android.window.WindowContainerToken, @NonNull android.view.SurfaceControl.Transaction);
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction setErrorCallbackToken(@NonNull android.os.IBinder);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setFocusable(@NonNull android.window.WindowContainerToken, boolean);
|
method @NonNull public android.window.WindowContainerTransaction setFocusable(@NonNull android.window.WindowContainerToken, boolean);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setHidden(@NonNull android.window.WindowContainerToken, boolean);
|
method @NonNull public android.window.WindowContainerTransaction setHidden(@NonNull android.window.WindowContainerToken, boolean);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setLaunchRoot(@NonNull android.window.WindowContainerToken, @Nullable int[], @Nullable int[]);
|
method @NonNull public android.window.WindowContainerTransaction setLaunchRoot(@NonNull android.window.WindowContainerToken, @Nullable int[], @Nullable int[]);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setScreenSizeDp(@NonNull android.window.WindowContainerToken, int, int);
|
method @NonNull public android.window.WindowContainerTransaction setScreenSizeDp(@NonNull android.window.WindowContainerToken, int, int);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setSmallestScreenWidthDp(@NonNull android.window.WindowContainerToken, int);
|
method @NonNull public android.window.WindowContainerTransaction setSmallestScreenWidthDp(@NonNull android.window.WindowContainerToken, int);
|
||||||
method @NonNull public android.window.WindowContainerTransaction setWindowingMode(@NonNull android.window.WindowContainerToken, int);
|
method @NonNull public android.window.WindowContainerTransaction setWindowingMode(@NonNull android.window.WindowContainerToken, int);
|
||||||
|
method @NonNull public android.window.WindowContainerTransaction startActivityInTaskFragment(@NonNull android.os.IBinder, @NonNull android.os.IBinder, @NonNull android.content.Intent, @Nullable android.os.Bundle);
|
||||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.window.WindowContainerTransaction> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.window.WindowContainerTransaction> CREATOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.window;
|
package android.window;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
@@ -25,6 +26,7 @@ import android.view.SurfaceControl;
|
|||||||
* Data object for the TaskFragment info provided when a TaskFragment is presented to an organizer.
|
* Data object for the TaskFragment info provided when a TaskFragment is presented to an organizer.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@TestApi
|
||||||
public final class TaskFragmentAppearedInfo implements Parcelable {
|
public final class TaskFragmentAppearedInfo implements Parcelable {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -33,16 +35,19 @@ public final class TaskFragmentAppearedInfo implements Parcelable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
private final SurfaceControl mLeash;
|
private final SurfaceControl mLeash;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
public TaskFragmentAppearedInfo(
|
public TaskFragmentAppearedInfo(
|
||||||
@NonNull TaskFragmentInfo taskFragmentInfo, @NonNull SurfaceControl leash) {
|
@NonNull TaskFragmentInfo taskFragmentInfo, @NonNull SurfaceControl leash) {
|
||||||
mTaskFragmentInfo = taskFragmentInfo;
|
mTaskFragmentInfo = taskFragmentInfo;
|
||||||
mLeash = leash;
|
mLeash = leash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public TaskFragmentInfo getTaskFragmentInfo() {
|
public TaskFragmentInfo getTaskFragmentInfo() {
|
||||||
return mTaskFragmentInfo;
|
return mTaskFragmentInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public SurfaceControl getLeash() {
|
public SurfaceControl getLeash() {
|
||||||
return mLeash;
|
return mLeash;
|
||||||
}
|
}
|
||||||
@@ -52,6 +57,7 @@ public final class TaskFragmentAppearedInfo implements Parcelable {
|
|||||||
mLeash = in.readTypedObject(SurfaceControl.CREATOR);
|
mLeash = in.readTypedObject(SurfaceControl.CREATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
dest.writeTypedObject(mTaskFragmentInfo, flags);
|
dest.writeTypedObject(mTaskFragmentInfo, flags);
|
||||||
@@ -79,6 +85,7 @@ public final class TaskFragmentAppearedInfo implements Parcelable {
|
|||||||
+ "}";
|
+ "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
|||||||
import static android.app.WindowConfiguration.WindowingMode;
|
import static android.app.WindowConfiguration.WindowingMode;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -29,11 +30,12 @@ import android.os.Parcelable;
|
|||||||
* Data object for options to create TaskFragment with.
|
* Data object for options to create TaskFragment with.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@TestApi
|
||||||
public final class TaskFragmentCreationParams implements Parcelable {
|
public final class TaskFragmentCreationParams implements Parcelable {
|
||||||
|
|
||||||
/** The organizer that will organize this TaskFragment. */
|
/** The organizer that will organize this TaskFragment. */
|
||||||
@NonNull
|
@NonNull
|
||||||
private final ITaskFragmentOrganizer mOrganizer;
|
private final TaskFragmentOrganizerToken mOrganizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unique token assigned from the client organizer to identify the {@link TaskFragmentInfo} when
|
* Unique token assigned from the client organizer to identify the {@link TaskFragmentInfo} when
|
||||||
@@ -58,25 +60,29 @@ public final class TaskFragmentCreationParams implements Parcelable {
|
|||||||
private int mWindowingMode = WINDOWING_MODE_UNDEFINED;
|
private int mWindowingMode = WINDOWING_MODE_UNDEFINED;
|
||||||
|
|
||||||
private TaskFragmentCreationParams(
|
private TaskFragmentCreationParams(
|
||||||
@NonNull ITaskFragmentOrganizer organizer, @NonNull IBinder fragmentToken,
|
@NonNull TaskFragmentOrganizerToken organizer,
|
||||||
@NonNull IBinder ownerToken) {
|
@NonNull IBinder fragmentToken, @NonNull IBinder ownerToken) {
|
||||||
mOrganizer = organizer;
|
mOrganizer = organizer;
|
||||||
mFragmentToken = fragmentToken;
|
mFragmentToken = fragmentToken;
|
||||||
mOwnerToken = ownerToken;
|
mOwnerToken = ownerToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ITaskFragmentOrganizer getOrganizer() {
|
@NonNull
|
||||||
|
public TaskFragmentOrganizerToken getOrganizer() {
|
||||||
return mOrganizer;
|
return mOrganizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public IBinder getFragmentToken() {
|
public IBinder getFragmentToken() {
|
||||||
return mFragmentToken;
|
return mFragmentToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public IBinder getOwnerToken() {
|
public IBinder getOwnerToken() {
|
||||||
return mOwnerToken;
|
return mOwnerToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public Rect getInitialBounds() {
|
public Rect getInitialBounds() {
|
||||||
return mInitialBounds;
|
return mInitialBounds;
|
||||||
}
|
}
|
||||||
@@ -87,16 +93,17 @@ public final class TaskFragmentCreationParams implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TaskFragmentCreationParams(Parcel in) {
|
private TaskFragmentCreationParams(Parcel in) {
|
||||||
mOrganizer = ITaskFragmentOrganizer.Stub.asInterface(in.readStrongBinder());
|
mOrganizer = TaskFragmentOrganizerToken.CREATOR.createFromParcel(in);
|
||||||
mFragmentToken = in.readStrongBinder();
|
mFragmentToken = in.readStrongBinder();
|
||||||
mOwnerToken = in.readStrongBinder();
|
mOwnerToken = in.readStrongBinder();
|
||||||
mInitialBounds.readFromParcel(in);
|
mInitialBounds.readFromParcel(in);
|
||||||
mWindowingMode = in.readInt();
|
mWindowingMode = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
dest.writeStrongInterface(mOrganizer);
|
mOrganizer.writeToParcel(dest, flags);
|
||||||
dest.writeStrongBinder(mFragmentToken);
|
dest.writeStrongBinder(mFragmentToken);
|
||||||
dest.writeStrongBinder(mOwnerToken);
|
dest.writeStrongBinder(mOwnerToken);
|
||||||
mInitialBounds.writeToParcel(dest, flags);
|
mInitialBounds.writeToParcel(dest, flags);
|
||||||
@@ -128,16 +135,17 @@ public final class TaskFragmentCreationParams implements Parcelable {
|
|||||||
+ "}";
|
+ "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Builder to construct the options to create TaskFragment with. */
|
/** Builder to construct the options to create TaskFragment with. */
|
||||||
public static class Builder {
|
public static final class Builder {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final ITaskFragmentOrganizer mOrganizer;
|
private final TaskFragmentOrganizerToken mOrganizer;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final IBinder mFragmentToken;
|
private final IBinder mFragmentToken;
|
||||||
@@ -151,26 +159,29 @@ public final class TaskFragmentCreationParams implements Parcelable {
|
|||||||
@WindowingMode
|
@WindowingMode
|
||||||
private int mWindowingMode = WINDOWING_MODE_UNDEFINED;
|
private int mWindowingMode = WINDOWING_MODE_UNDEFINED;
|
||||||
|
|
||||||
public Builder(@NonNull ITaskFragmentOrganizer organizer, @NonNull IBinder fragmentToken,
|
public Builder(@NonNull TaskFragmentOrganizerToken organizer,
|
||||||
@NonNull IBinder ownerToken) {
|
@NonNull IBinder fragmentToken, @NonNull IBinder ownerToken) {
|
||||||
mOrganizer = organizer;
|
mOrganizer = organizer;
|
||||||
mFragmentToken = fragmentToken;
|
mFragmentToken = fragmentToken;
|
||||||
mOwnerToken = ownerToken;
|
mOwnerToken = ownerToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the initial bounds for the TaskFragment. */
|
/** Sets the initial bounds for the TaskFragment. */
|
||||||
|
@NonNull
|
||||||
public Builder setInitialBounds(@NonNull Rect bounds) {
|
public Builder setInitialBounds(@NonNull Rect bounds) {
|
||||||
mInitialBounds.set(bounds);
|
mInitialBounds.set(bounds);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the initial windowing mode for the TaskFragment. */
|
/** Sets the initial windowing mode for the TaskFragment. */
|
||||||
|
@NonNull
|
||||||
public Builder setWindowingMode(@WindowingMode int windowingMode) {
|
public Builder setWindowingMode(@WindowingMode int windowingMode) {
|
||||||
mWindowingMode = windowingMode;
|
mWindowingMode = windowingMode;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constructs the options to create TaskFragment with. */
|
/** Constructs the options to create TaskFragment with. */
|
||||||
|
@NonNull
|
||||||
public TaskFragmentCreationParams build() {
|
public TaskFragmentCreationParams build() {
|
||||||
final TaskFragmentCreationParams result = new TaskFragmentCreationParams(
|
final TaskFragmentCreationParams result = new TaskFragmentCreationParams(
|
||||||
mOrganizer, mFragmentToken, mOwnerToken);
|
mOrganizer, mFragmentToken, mOwnerToken);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import static java.util.Objects.requireNonNull;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -35,6 +36,7 @@ import java.util.List;
|
|||||||
* Stores information about a particular TaskFragment.
|
* Stores information about a particular TaskFragment.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@TestApi
|
||||||
public final class TaskFragmentInfo implements Parcelable {
|
public final class TaskFragmentInfo implements Parcelable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,11 +65,13 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
* List of Activity tokens that are children of this TaskFragment. It only contains Activities
|
* List of Activity tokens that are children of this TaskFragment. It only contains Activities
|
||||||
* that belong to the organizer process for security.
|
* that belong to the organizer process for security.
|
||||||
*/
|
*/
|
||||||
|
@NonNull
|
||||||
private final List<IBinder> mActivities = new ArrayList<>();
|
private final List<IBinder> mActivities = new ArrayList<>();
|
||||||
|
|
||||||
/** Relative position of the fragment's top left corner in the parent container. */
|
/** Relative position of the fragment's top left corner in the parent container. */
|
||||||
private final Point mPositionInParent;
|
private final Point mPositionInParent;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
public TaskFragmentInfo(
|
public TaskFragmentInfo(
|
||||||
@NonNull IBinder fragmentToken, @NonNull WindowContainerToken token,
|
@NonNull IBinder fragmentToken, @NonNull WindowContainerToken token,
|
||||||
@NonNull Configuration configuration, boolean isEmpty, boolean hasRunningActivity,
|
@NonNull Configuration configuration, boolean isEmpty, boolean hasRunningActivity,
|
||||||
@@ -82,14 +86,17 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
mPositionInParent = requireNonNull(positionInParent);
|
mPositionInParent = requireNonNull(positionInParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public IBinder getFragmentToken() {
|
public IBinder getFragmentToken() {
|
||||||
return mFragmentToken;
|
return mFragmentToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public WindowContainerToken getToken() {
|
public WindowContainerToken getToken() {
|
||||||
return mToken;
|
return mToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public Configuration getConfiguration() {
|
public Configuration getConfiguration() {
|
||||||
return mConfiguration;
|
return mConfiguration;
|
||||||
}
|
}
|
||||||
@@ -106,6 +113,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
return mIsVisible;
|
return mIsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public List<IBinder> getActivities() {
|
public List<IBinder> getActivities() {
|
||||||
return mActivities;
|
return mActivities;
|
||||||
}
|
}
|
||||||
@@ -151,6 +159,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
mPositionInParent = requireNonNull(in.readTypedObject(Point.CREATOR));
|
mPositionInParent = requireNonNull(in.readTypedObject(Point.CREATOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
dest.writeStrongBinder(mFragmentToken);
|
dest.writeStrongBinder(mFragmentToken);
|
||||||
@@ -189,6 +198,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
+ "}";
|
+ "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.window;
|
|||||||
|
|
||||||
import android.annotation.CallSuper;
|
import android.annotation.CallSuper;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -26,9 +27,10 @@ import android.os.RemoteException;
|
|||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for WindowManager to delegate control of {@link com.android.server.wm.TaskFragment}.
|
* Interface for WindowManager to delegate control of {@code TaskFragment}.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@TestApi
|
||||||
public class TaskFragmentOrganizer extends WindowOrganizer {
|
public class TaskFragmentOrganizer extends WindowOrganizer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,6 +41,7 @@ public class TaskFragmentOrganizer extends WindowOrganizer {
|
|||||||
/**
|
/**
|
||||||
* Creates a {@link Bundle} with an exception that can be passed to
|
* Creates a {@link Bundle} with an exception that can be passed to
|
||||||
* {@link ITaskFragmentOrganizer#onTaskFragmentError}.
|
* {@link ITaskFragmentOrganizer#onTaskFragmentError}.
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static Bundle putExceptionInBundle(@NonNull Throwable exception) {
|
public static Bundle putExceptionInBundle(@NonNull Throwable exception) {
|
||||||
final Bundle exceptionBundle = new Bundle();
|
final Bundle exceptionBundle = new Bundle();
|
||||||
@@ -126,6 +129,8 @@ public class TaskFragmentOrganizer extends WindowOrganizer {
|
|||||||
super.applyTransaction(t);
|
super.applyTransaction(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Suppress the lint because it is not a registration method.
|
||||||
|
@SuppressWarnings("ExecutorRegistration")
|
||||||
@Override
|
@Override
|
||||||
public int applySyncTransaction(@NonNull WindowContainerTransaction t,
|
public int applySyncTransaction(@NonNull WindowContainerTransaction t,
|
||||||
@NonNull WindowContainerTransactionCallback callback) {
|
@NonNull WindowContainerTransactionCallback callback) {
|
||||||
@@ -169,8 +174,11 @@ public class TaskFragmentOrganizer extends WindowOrganizer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public ITaskFragmentOrganizer getIOrganizer() {
|
private final TaskFragmentOrganizerToken mToken = new TaskFragmentOrganizerToken(mInterface);
|
||||||
return mInterface;
|
|
||||||
|
@NonNull
|
||||||
|
public TaskFragmentOrganizerToken getOrganizerToken() {
|
||||||
|
return mToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ITaskFragmentOrganizerController getController() {
|
private ITaskFragmentOrganizerController getController() {
|
||||||
|
|||||||
97
core/java/android/window/TaskFragmentOrganizerToken.java
Normal file
97
core/java/android/window/TaskFragmentOrganizerToken.java
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package android.window;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.TestApi;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface to communicate between window manager and {@link TaskFragmentOrganizer}.
|
||||||
|
* <p>
|
||||||
|
* Window manager will dispatch TaskFragment information updates via this interface.
|
||||||
|
* It is necessary because {@link ITaskFragmentOrganizer} aidl interface can not be used as a
|
||||||
|
* {@link TestApi}.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@TestApi
|
||||||
|
public final class TaskFragmentOrganizerToken implements Parcelable {
|
||||||
|
private final ITaskFragmentOrganizer mRealToken;
|
||||||
|
|
||||||
|
TaskFragmentOrganizerToken(ITaskFragmentOrganizer realToken) {
|
||||||
|
mRealToken = realToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
public IBinder asBinder() {
|
||||||
|
return mRealToken.asBinder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeStrongInterface(mRealToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public static final Creator<TaskFragmentOrganizerToken> CREATOR =
|
||||||
|
new Creator<TaskFragmentOrganizerToken>() {
|
||||||
|
@Override
|
||||||
|
public TaskFragmentOrganizerToken createFromParcel(Parcel in) {
|
||||||
|
final ITaskFragmentOrganizer realToken =
|
||||||
|
ITaskFragmentOrganizer.Stub.asInterface(in.readStrongBinder());
|
||||||
|
// The TaskFragmentOrganizerToken may be null for TaskOrganizer or
|
||||||
|
// DisplayAreaOrganizer.
|
||||||
|
if (realToken == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new TaskFragmentOrganizerToken(realToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TaskFragmentOrganizerToken[] newArray(int size) {
|
||||||
|
return new TaskFragmentOrganizerToken[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return mRealToken.asBinder().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TaskFragmentOrganizerToken{" + mRealToken + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(@Nullable Object obj) {
|
||||||
|
if (!(obj instanceof TaskFragmentOrganizerToken)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return mRealToken.asBinder() == ((TaskFragmentOrganizerToken) obj).asBinder();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -410,7 +410,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Creates a new TaskFragment with the given options.
|
* Creates a new TaskFragment with the given options.
|
||||||
* @param taskFragmentOptions the options used to create the TaskFragment.
|
* @param taskFragmentOptions the options used to create the TaskFragment.
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction createTaskFragment(
|
public WindowContainerTransaction createTaskFragment(
|
||||||
@@ -426,7 +425,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Deletes an existing TaskFragment. Any remaining activities below it will be destroyed.
|
* Deletes an existing TaskFragment. Any remaining activities below it will be destroyed.
|
||||||
* @param taskFragment the TaskFragment to be removed.
|
* @param taskFragment the TaskFragment to be removed.
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction deleteTaskFragment(
|
public WindowContainerTransaction deleteTaskFragment(
|
||||||
@@ -447,7 +445,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
* @param activityIntent intent to start the activity.
|
* @param activityIntent intent to start the activity.
|
||||||
* @param activityOptions ActivityOptions to start the activity with.
|
* @param activityOptions ActivityOptions to start the activity with.
|
||||||
* @see android.content.Context#startActivity(Intent, Bundle).
|
* @see android.content.Context#startActivity(Intent, Bundle).
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction startActivityInTaskFragment(
|
public WindowContainerTransaction startActivityInTaskFragment(
|
||||||
@@ -470,7 +467,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
* @param fragmentToken client assigned unique token to create TaskFragment with specified in
|
* @param fragmentToken client assigned unique token to create TaskFragment with specified in
|
||||||
* {@link TaskFragmentCreationParams#getFragmentToken()}.
|
* {@link TaskFragmentCreationParams#getFragmentToken()}.
|
||||||
* @param activityToken activity to be reparented.
|
* @param activityToken activity to be reparented.
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction reparentActivityToTaskFragment(
|
public WindowContainerTransaction reparentActivityToTaskFragment(
|
||||||
@@ -490,7 +486,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
* @param oldParent children of this TaskFragment will be reparented.
|
* @param oldParent children of this TaskFragment will be reparented.
|
||||||
* @param newParent the new parent TaskFragment to move the children to. If {@code null}, the
|
* @param newParent the new parent TaskFragment to move the children to. If {@code null}, the
|
||||||
* children will be moved to the leaf Task.
|
* children will be moved to the leaf Task.
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction reparentChildren(
|
public WindowContainerTransaction reparentChildren(
|
||||||
@@ -535,7 +530,6 @@ public final class WindowContainerTransaction implements Parcelable {
|
|||||||
* @param errorCallbackToken client provided token that will be passed back as parameter in
|
* @param errorCallbackToken client provided token that will be passed back as parameter in
|
||||||
* the callback if there is an error on the server side.
|
* the callback if there is an error on the server side.
|
||||||
* @see ITaskFragmentOrganizer#onTaskFragmentError
|
* @see ITaskFragmentOrganizer#onTaskFragmentError
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public WindowContainerTransaction setErrorCallbackToken(@NonNull IBinder errorCallbackToken) {
|
public WindowContainerTransaction setErrorCallbackToken(@NonNull IBinder errorCallbackToken) {
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new TaskFragmentCreationParams.Builder(
|
return new TaskFragmentCreationParams.Builder(
|
||||||
getIOrganizer(),
|
getOrganizerToken(),
|
||||||
fragmentToken,
|
fragmentToken,
|
||||||
ownerToken)
|
ownerToken)
|
||||||
.setInitialBounds(bounds)
|
.setInitialBounds(bounds)
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ import android.view.DisplayInfo;
|
|||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.window.ITaskFragmentOrganizer;
|
import android.window.ITaskFragmentOrganizer;
|
||||||
import android.window.TaskFragmentInfo;
|
import android.window.TaskFragmentInfo;
|
||||||
|
import android.window.TaskFragmentOrganizerToken;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.protolog.common.ProtoLog;
|
import com.android.internal.protolog.common.ProtoLog;
|
||||||
@@ -285,8 +286,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
taskFragment.mAdjacentTaskFragment = this;
|
taskFragment.mAdjacentTaskFragment = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTaskFragmentOrganizer(ITaskFragmentOrganizer organizer, int pid) {
|
void setTaskFragmentOrganizer(TaskFragmentOrganizerToken organizer, int pid) {
|
||||||
mTaskFragmentOrganizer = organizer;
|
mTaskFragmentOrganizer = ITaskFragmentOrganizer.Stub.asInterface(organizer.asBinder());
|
||||||
mTaskFragmentOrganizerPid = pid;
|
mTaskFragmentOrganizerPid = pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1109,11 +1109,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
@Nullable IBinder errorCallbackToken) {
|
@Nullable IBinder errorCallbackToken) {
|
||||||
final ActivityRecord ownerActivity =
|
final ActivityRecord ownerActivity =
|
||||||
ActivityRecord.forTokenLocked(creationParams.getOwnerToken());
|
ActivityRecord.forTokenLocked(creationParams.getOwnerToken());
|
||||||
|
final ITaskFragmentOrganizer organizer = ITaskFragmentOrganizer.Stub.asInterface(
|
||||||
|
creationParams.getOrganizer().asBinder());
|
||||||
|
|
||||||
if (ownerActivity == null || ownerActivity.getTask() == null) {
|
if (ownerActivity == null || ownerActivity.getTask() == null) {
|
||||||
final Throwable exception =
|
final Throwable exception =
|
||||||
new IllegalArgumentException("Not allowed to operate with invalid ownerToken");
|
new IllegalArgumentException("Not allowed to operate with invalid ownerToken");
|
||||||
sendTaskFragmentOperationFailure(creationParams.getOrganizer(), errorCallbackToken,
|
sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception);
|
||||||
exception);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// The ownerActivity has to belong to the same app as the root Activity of the target Task.
|
// The ownerActivity has to belong to the same app as the root Activity of the target Task.
|
||||||
@@ -1122,8 +1124,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
final Throwable exception =
|
final Throwable exception =
|
||||||
new IllegalArgumentException("Not allowed to operate with the ownerToken while "
|
new IllegalArgumentException("Not allowed to operate with the ownerToken while "
|
||||||
+ "the root activity of the target task belong to the different app");
|
+ "the root activity of the target task belong to the different app");
|
||||||
sendTaskFragmentOperationFailure(creationParams.getOrganizer(), errorCallbackToken,
|
sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception);
|
||||||
exception);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final TaskFragment taskFragment = new TaskFragment(mService,
|
final TaskFragment taskFragment = new TaskFragment(mService,
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import android.window.ITaskFragmentOrganizer;
|
|||||||
import android.window.TaskFragmentCreationParams;
|
import android.window.TaskFragmentCreationParams;
|
||||||
import android.window.TaskFragmentInfo;
|
import android.window.TaskFragmentInfo;
|
||||||
import android.window.TaskFragmentOrganizer;
|
import android.window.TaskFragmentOrganizer;
|
||||||
|
import android.window.TaskFragmentOrganizerToken;
|
||||||
import android.window.WindowContainerToken;
|
import android.window.WindowContainerToken;
|
||||||
import android.window.WindowContainerTransaction;
|
import android.window.WindowContainerTransaction;
|
||||||
import android.window.WindowContainerTransactionCallback;
|
import android.window.WindowContainerTransactionCallback;
|
||||||
@@ -62,6 +63,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
|
|
||||||
private TaskFragmentOrganizerController mController;
|
private TaskFragmentOrganizerController mController;
|
||||||
private TaskFragmentOrganizer mOrganizer;
|
private TaskFragmentOrganizer mOrganizer;
|
||||||
|
private TaskFragmentOrganizerToken mOrganizerToken;
|
||||||
private ITaskFragmentOrganizer mIOrganizer;
|
private ITaskFragmentOrganizer mIOrganizer;
|
||||||
private TaskFragment mTaskFragment;
|
private TaskFragment mTaskFragment;
|
||||||
private TaskFragmentInfo mTaskFragmentInfo;
|
private TaskFragmentInfo mTaskFragmentInfo;
|
||||||
@@ -73,7 +75,8 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
public void setup() {
|
public void setup() {
|
||||||
mController = mWm.mAtmService.mWindowOrganizerController.mTaskFragmentOrganizerController;
|
mController = mWm.mAtmService.mWindowOrganizerController.mTaskFragmentOrganizerController;
|
||||||
mOrganizer = new TaskFragmentOrganizer(Runnable::run);
|
mOrganizer = new TaskFragmentOrganizer(Runnable::run);
|
||||||
mIOrganizer = mOrganizer.getIOrganizer();
|
mOrganizerToken = mOrganizer.getOrganizerToken();
|
||||||
|
mIOrganizer = ITaskFragmentOrganizer.Stub.asInterface(mOrganizerToken.asBinder());
|
||||||
mTaskFragmentInfo = mock(TaskFragmentInfo.class);
|
mTaskFragmentInfo = mock(TaskFragmentInfo.class);
|
||||||
mFragmentToken = new Binder();
|
mFragmentToken = new Binder();
|
||||||
mTaskFragment =
|
mTaskFragment =
|
||||||
@@ -235,7 +238,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Allow transaction to change a TaskFragment created by the organizer.
|
// Allow transaction to change a TaskFragment created by the organizer.
|
||||||
mTaskFragment.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
mTaskFragment.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
|
|
||||||
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
||||||
}
|
}
|
||||||
@@ -257,7 +260,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Allow transaction to change a TaskFragment created by the organizer.
|
// Allow transaction to change a TaskFragment created by the organizer.
|
||||||
mTaskFragment.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
mTaskFragment.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
|
|
||||||
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
||||||
}
|
}
|
||||||
@@ -280,7 +283,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Allow transaction to change a TaskFragment created by the organizer.
|
// Allow transaction to change a TaskFragment created by the organizer.
|
||||||
mTaskFragment.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
mTaskFragment.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
|
|
||||||
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
||||||
}
|
}
|
||||||
@@ -306,8 +309,8 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Allow transaction to change a TaskFragment created by the organizer.
|
// Allow transaction to change a TaskFragment created by the organizer.
|
||||||
mTaskFragment.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
mTaskFragment.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
taskFragment2.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
taskFragment2.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
|
|
||||||
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
||||||
}
|
}
|
||||||
@@ -317,7 +320,9 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
mOrganizer.applyTransaction(mTransaction);
|
mOrganizer.applyTransaction(mTransaction);
|
||||||
|
|
||||||
// Allow organizer to create TaskFragment and start/reparent activity to TaskFragment.
|
// Allow organizer to create TaskFragment and start/reparent activity to TaskFragment.
|
||||||
mTransaction.createTaskFragment(mock(TaskFragmentCreationParams.class));
|
final TaskFragmentCreationParams mockParams = mock(TaskFragmentCreationParams.class);
|
||||||
|
doReturn(mOrganizerToken).when(mockParams).getOrganizer();
|
||||||
|
mTransaction.createTaskFragment(mockParams);
|
||||||
mTransaction.startActivityInTaskFragment(
|
mTransaction.startActivityInTaskFragment(
|
||||||
mFragmentToken, null /* callerToken */, new Intent(), null /* activityOptions */);
|
mFragmentToken, null /* callerToken */, new Intent(), null /* activityOptions */);
|
||||||
mTransaction.reparentActivityToTaskFragment(mFragmentToken, mock(IBinder.class));
|
mTransaction.reparentActivityToTaskFragment(mFragmentToken, mock(IBinder.class));
|
||||||
@@ -352,7 +357,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Allow transaction to change a TaskFragment created by the organizer.
|
// Allow transaction to change a TaskFragment created by the organizer.
|
||||||
mTaskFragment.setTaskFragmentOrganizer(mIOrganizer, 10 /* pid */);
|
mTaskFragment.setTaskFragmentOrganizer(mOrganizerToken, 10 /* pid */);
|
||||||
|
|
||||||
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
mAtm.getWindowOrganizerController().applyTransaction(mTransaction);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user