Merge "Avoid calling getTopMostTask() twice in Task#fillTaskInfo()"
This commit is contained in:
committed by
Android (Google) Code Review
commit
c0ef54bc66
@@ -4125,7 +4125,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
info.positionInParent = getRelativePosition();
|
||||
info.parentBounds = getParentBounds();
|
||||
|
||||
info.pictureInPictureParams = getPictureInPictureParams();
|
||||
info.pictureInPictureParams = getPictureInPictureParams(top);
|
||||
info.topActivityInfo = mReuseActivitiesReport.top != null
|
||||
? mReuseActivitiesReport.top.info
|
||||
: null;
|
||||
@@ -4142,7 +4142,10 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
}
|
||||
|
||||
@Nullable PictureInPictureParams getPictureInPictureParams() {
|
||||
final Task top = getTopMostTask();
|
||||
return getPictureInPictureParams(getTopMostTask());
|
||||
}
|
||||
|
||||
private @Nullable PictureInPictureParams getPictureInPictureParams(Task top) {
|
||||
if (top == null) return null;
|
||||
final ActivityRecord rootActivity = top.getRootActivity();
|
||||
return (rootActivity == null || rootActivity.pictureInPictureArgs.empty())
|
||||
|
||||
Reference in New Issue
Block a user