Merge "Add hasRunningActivity in TaskFragmentInfo" into sc-v2-dev
This commit is contained in:
@@ -38,8 +38,8 @@ import java.util.List;
|
|||||||
public final class TaskFragmentInfo implements Parcelable {
|
public final class TaskFragmentInfo implements Parcelable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client assigned unique token in {@link TaskFragmentCreationParams#mFragmentToken} to create
|
* Client assigned unique token in {@link TaskFragmentCreationParams#getFragmentToken()} to
|
||||||
* this TaskFragment with.
|
* create this TaskFragment with.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
private final IBinder mFragmentToken;
|
private final IBinder mFragmentToken;
|
||||||
@@ -50,9 +50,12 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
private final Configuration mConfiguration = new Configuration();
|
private final Configuration mConfiguration = new Configuration();
|
||||||
|
|
||||||
/** Whether the TaskFragment contains any child Activity. */
|
/** Whether the TaskFragment contains any child Window Container. */
|
||||||
private final boolean mIsEmpty;
|
private final boolean mIsEmpty;
|
||||||
|
|
||||||
|
/** Whether the TaskFragment contains any running Activity. */
|
||||||
|
private final boolean mHasRunningActivity;
|
||||||
|
|
||||||
/** Whether this TaskFragment is visible on the window hierarchy. */
|
/** Whether this TaskFragment is visible on the window hierarchy. */
|
||||||
private final boolean mIsVisible;
|
private final boolean mIsVisible;
|
||||||
|
|
||||||
@@ -67,12 +70,13 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
|
|
||||||
public TaskFragmentInfo(
|
public TaskFragmentInfo(
|
||||||
@NonNull IBinder fragmentToken, @NonNull WindowContainerToken token,
|
@NonNull IBinder fragmentToken, @NonNull WindowContainerToken token,
|
||||||
@NonNull Configuration configuration, boolean isEmpty, boolean isVisible,
|
@NonNull Configuration configuration, boolean isEmpty, boolean hasRunningActivity,
|
||||||
List<IBinder> activities, @NonNull Point positionInParent) {
|
boolean isVisible, @NonNull List<IBinder> activities, @NonNull Point positionInParent) {
|
||||||
mFragmentToken = requireNonNull(fragmentToken);
|
mFragmentToken = requireNonNull(fragmentToken);
|
||||||
mToken = requireNonNull(token);
|
mToken = requireNonNull(token);
|
||||||
mConfiguration.setTo(configuration);
|
mConfiguration.setTo(configuration);
|
||||||
mIsEmpty = isEmpty;
|
mIsEmpty = isEmpty;
|
||||||
|
mHasRunningActivity = hasRunningActivity;
|
||||||
mIsVisible = isVisible;
|
mIsVisible = isVisible;
|
||||||
mActivities.addAll(activities);
|
mActivities.addAll(activities);
|
||||||
mPositionInParent = requireNonNull(positionInParent);
|
mPositionInParent = requireNonNull(positionInParent);
|
||||||
@@ -94,6 +98,10 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
return mIsEmpty;
|
return mIsEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasRunningActivity() {
|
||||||
|
return mHasRunningActivity;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVisible() {
|
public boolean isVisible() {
|
||||||
return mIsVisible;
|
return mIsVisible;
|
||||||
}
|
}
|
||||||
@@ -125,6 +133,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
return mFragmentToken.equals(that.mFragmentToken)
|
return mFragmentToken.equals(that.mFragmentToken)
|
||||||
&& mToken.equals(that.mToken)
|
&& mToken.equals(that.mToken)
|
||||||
&& mIsEmpty == that.mIsEmpty
|
&& mIsEmpty == that.mIsEmpty
|
||||||
|
&& mHasRunningActivity == that.mHasRunningActivity
|
||||||
&& mIsVisible == that.mIsVisible
|
&& mIsVisible == that.mIsVisible
|
||||||
&& getWindowingMode() == that.getWindowingMode()
|
&& getWindowingMode() == that.getWindowingMode()
|
||||||
&& mActivities.equals(that.mActivities)
|
&& mActivities.equals(that.mActivities)
|
||||||
@@ -136,6 +145,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
mToken = in.readTypedObject(WindowContainerToken.CREATOR);
|
mToken = in.readTypedObject(WindowContainerToken.CREATOR);
|
||||||
mConfiguration.readFromParcel(in);
|
mConfiguration.readFromParcel(in);
|
||||||
mIsEmpty = in.readBoolean();
|
mIsEmpty = in.readBoolean();
|
||||||
|
mHasRunningActivity = in.readBoolean();
|
||||||
mIsVisible = in.readBoolean();
|
mIsVisible = in.readBoolean();
|
||||||
in.readBinderList(mActivities);
|
in.readBinderList(mActivities);
|
||||||
mPositionInParent = requireNonNull(in.readTypedObject(Point.CREATOR));
|
mPositionInParent = requireNonNull(in.readTypedObject(Point.CREATOR));
|
||||||
@@ -147,6 +157,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
dest.writeTypedObject(mToken, flags);
|
dest.writeTypedObject(mToken, flags);
|
||||||
mConfiguration.writeToParcel(dest, flags);
|
mConfiguration.writeToParcel(dest, flags);
|
||||||
dest.writeBoolean(mIsEmpty);
|
dest.writeBoolean(mIsEmpty);
|
||||||
|
dest.writeBoolean(mHasRunningActivity);
|
||||||
dest.writeBoolean(mIsVisible);
|
dest.writeBoolean(mIsVisible);
|
||||||
dest.writeBinderList(mActivities);
|
dest.writeBinderList(mActivities);
|
||||||
dest.writeTypedObject(mPositionInParent, flags);
|
dest.writeTypedObject(mPositionInParent, flags);
|
||||||
@@ -172,6 +183,7 @@ public final class TaskFragmentInfo implements Parcelable {
|
|||||||
+ " fragmentToken=" + mFragmentToken
|
+ " fragmentToken=" + mFragmentToken
|
||||||
+ " token=" + mToken
|
+ " token=" + mToken
|
||||||
+ " isEmpty=" + mIsEmpty
|
+ " isEmpty=" + mIsEmpty
|
||||||
|
+ " hasRunningActivity=" + mHasRunningActivity
|
||||||
+ " isVisible=" + mIsVisible
|
+ " isVisible=" + mIsVisible
|
||||||
+ " positionInParent=" + mPositionInParent
|
+ " positionInParent=" + mPositionInParent
|
||||||
+ "}";
|
+ "}";
|
||||||
|
|||||||
@@ -3446,6 +3446,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
finishing = true;
|
finishing = true;
|
||||||
|
final TaskFragment taskFragment = getTaskFragment();
|
||||||
|
if (taskFragment != null) {
|
||||||
|
taskFragment.sendTaskFragmentInfoChanged();
|
||||||
|
}
|
||||||
if (stopped) {
|
if (stopped) {
|
||||||
abortAndClearOptionsAnimation();
|
abortAndClearOptionsAnimation();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1895,6 +1895,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
mRemoteToken.toWindowContainerToken(),
|
mRemoteToken.toWindowContainerToken(),
|
||||||
getConfiguration(),
|
getConfiguration(),
|
||||||
getChildCount() == 0,
|
getChildCount() == 0,
|
||||||
|
hasRunningActivity(this),
|
||||||
isVisible(),
|
isVisible(),
|
||||||
childActivities,
|
childActivities,
|
||||||
positionInParent);
|
positionInParent);
|
||||||
|
|||||||
Reference in New Issue
Block a user