Merge "Add a featureId to TaskInfo." into sc-v2-dev am: fd72fb48bf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080962

Change-Id: I2e1ef9fb622dac26be462b98aaf8a7251346d0c8
This commit is contained in:
Yuncheol Heo
2021-06-25 17:11:55 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
package android.app;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -116,6 +117,12 @@ public class TaskInfo {
*/
public int displayId;
/**
* The feature id of {@link com.android.server.wm.TaskDisplayArea} this task is associated with.
* @hide
*/
public int displayAreaFeatureId = FEATURE_UNDEFINED;
/**
* The recent activity values for the highest activity in the stack to have set the values.
* {@link Activity#setTaskDescription(android.app.ActivityManager.TaskDescription)}.
@@ -342,6 +349,7 @@ public class TaskInfo {
return topActivityType == that.topActivityType
&& isResizeable == that.isResizeable
&& supportsMultiWindow == that.supportsMultiWindow
&& displayAreaFeatureId == that.displayAreaFeatureId
&& Objects.equals(positionInParent, that.positionInParent)
&& Objects.equals(pictureInPictureParams, that.pictureInPictureParams)
&& getWindowingMode() == that.getWindowingMode()
@@ -406,6 +414,7 @@ public class TaskInfo {
topActivityToken = source.readStrongBinder();
topActivityInSizeCompat = source.readBoolean();
mTopActivityLocusId = source.readTypedObject(LocusId.CREATOR);
displayAreaFeatureId = source.readInt();
}
/**
@@ -445,6 +454,7 @@ public class TaskInfo {
dest.writeStrongBinder(topActivityToken);
dest.writeBoolean(topActivityInSizeCompat);
dest.writeTypedObject(mTopActivityLocusId, flags);
dest.writeInt(displayAreaFeatureId);
}
@Override
@@ -473,7 +483,8 @@ public class TaskInfo {
+ " isSleeping=" + isSleeping
+ " topActivityToken=" + topActivityToken
+ " topActivityInSizeCompat=" + topActivityInSizeCompat
+ " locusId= " + mTopActivityLocusId
+ " locusId=" + mTopActivityLocusId
+ " displayAreaFeatureId=" + displayAreaFeatureId
+ "}";
}
}

View File

@@ -3293,6 +3293,9 @@ class Task extends TaskFragment {
info.userId = isLeafTask() ? mUserId : mCurrentUser;
info.taskId = mTaskId;
info.displayId = getDisplayId();
if (tda != null) {
info.displayAreaFeatureId = tda.mFeatureId;
}
info.isRunning = getTopNonFinishingActivity() != null;
final Intent baseIntent = getBaseIntent();
// Make a copy of base intent because this is like a snapshot info.