From 2e725beeb3511f2a8059ae679cf36778fcd395d0 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Tue, 10 Mar 2020 11:01:28 -0700 Subject: Get PiP bounds from layout dimensions if applicable Per CDD change proposal, will honor the layout dimensions such as AndroidManifest_minWidth / AndroidManifest_minHeight specified by an activity. Specs in detail: go/cdd-proposal-pip-size Bug: 147360777 Test: atest PinnedStackTests PipBoundsHandlerTest Change-Id: I9752aa272968eff15eb7dd2a46ae4591c1c5727f --- core/java/android/app/TaskInfo.java | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'core/java/android/app/TaskInfo.java') diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java index 1a845476e108..b2dd0ef012d8 100644 --- a/core/java/android/app/TaskInfo.java +++ b/core/java/android/app/TaskInfo.java @@ -23,6 +23,7 @@ import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.os.Parcel; import android.os.RemoteException; @@ -161,6 +162,13 @@ public class TaskInfo { */ public @WindowConfiguration.ActivityType int topActivityType; + /** + * The {@link ActivityInfo} of the top activity in this task. + * @hide + */ + @Nullable + public ActivityInfo topActivityInfo; + TaskInfo() { // Do nothing } @@ -217,8 +225,11 @@ public class TaskInfo { token = IWindowContainer.Stub.asInterface(source.readStrongBinder()); topActivityType = source.readInt(); pictureInPictureParams = source.readInt() != 0 - ? PictureInPictureParams.CREATOR.createFromParcel(source) - : null; + ? PictureInPictureParams.CREATOR.createFromParcel(source) + : null; + topActivityInfo = source.readInt() != 0 + ? ActivityInfo.CREATOR.createFromParcel(source) + : null; } /** @@ -262,6 +273,12 @@ public class TaskInfo { dest.writeInt(1); pictureInPictureParams.writeToParcel(dest, flags); } + if (topActivityInfo == null) { + dest.writeInt(0); + } else { + dest.writeInt(1); + topActivityInfo.writeToParcel(dest, flags); + } } @Override @@ -278,6 +295,7 @@ public class TaskInfo { + " resizeMode=" + resizeMode + " token=" + token + " topActivityType=" + topActivityType - + " pictureInPictureParams=" + pictureInPictureParams; + + " pictureInPictureParams=" + pictureInPictureParams + + " topActivityInfo=" + topActivityInfo; } } -- cgit v1.2.3