Merge "Use actual resizability for split-screen operations" into rvc-dev am: 058a713a74 am: affc0e64ce am: 20f63988ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11854827 Change-Id: Ibc6a20635f0be5f4bd555c72403e06a6302a1621
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package android.app;
|
||||
|
||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.TestApi;
|
||||
@@ -170,6 +168,14 @@ public class TaskInfo {
|
||||
@Nullable
|
||||
public ActivityInfo topActivityInfo;
|
||||
|
||||
/**
|
||||
* Whether this task is resizable. Unlike {@link #resizeMode} (which is what the top activity
|
||||
* supports), this is what the system actually uses for resizability based on other policy and
|
||||
* developer options.
|
||||
* @hide
|
||||
*/
|
||||
public boolean isResizeable;
|
||||
|
||||
TaskInfo() {
|
||||
// Do nothing
|
||||
}
|
||||
@@ -192,11 +198,6 @@ public class TaskInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public boolean isResizable() {
|
||||
return resizeMode != RESIZE_MODE_UNRESIZEABLE;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@NonNull
|
||||
@TestApi
|
||||
@@ -245,6 +246,7 @@ public class TaskInfo {
|
||||
topActivityInfo = source.readInt() != 0
|
||||
? ActivityInfo.CREATOR.createFromParcel(source)
|
||||
: null;
|
||||
isResizeable = source.readBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,6 +296,7 @@ public class TaskInfo {
|
||||
dest.writeInt(1);
|
||||
topActivityInfo.writeToParcel(dest, flags);
|
||||
}
|
||||
dest.writeBoolean(isResizeable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -308,6 +311,7 @@ public class TaskInfo {
|
||||
+ " lastActiveTime=" + lastActiveTime
|
||||
+ " supportsSplitScreenMultiWindow=" + supportsSplitScreenMultiWindow
|
||||
+ " resizeMode=" + resizeMode
|
||||
+ " isResizeable=" + isResizeable
|
||||
+ " token=" + token
|
||||
+ " topActivityType=" + topActivityType
|
||||
+ " pictureInPictureParams=" + pictureInPictureParams
|
||||
|
||||
@@ -523,7 +523,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
|
||||
}
|
||||
|
||||
void ensureMinimizedSplit() {
|
||||
setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizable());
|
||||
setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizeable);
|
||||
if (!isDividerVisible()) {
|
||||
// Wasn't in split-mode yet, so enter now.
|
||||
if (DEBUG) {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class WindowManagerProxy {
|
||||
final ActivityManager.RunningTaskInfo ti = rootTasks.get(i);
|
||||
out.add(ti.token);
|
||||
if (ti.topActivityType == ACTIVITY_TYPE_HOME) {
|
||||
resizable = ti.isResizable();
|
||||
resizable = ti.isResizeable;
|
||||
}
|
||||
}
|
||||
return resizable;
|
||||
@@ -179,7 +179,7 @@ public class WindowManagerProxy {
|
||||
for (int i = rootTasks.size() - 1; i >= 0; --i) {
|
||||
final ActivityManager.RunningTaskInfo rootTask = rootTasks.get(i);
|
||||
// Only move resizeable task to split secondary. WM will just ignore this anyways...
|
||||
if (!rootTask.isResizable()) continue;
|
||||
if (!rootTask.isResizeable) continue;
|
||||
// Only move fullscreen tasks to split secondary.
|
||||
if (rootTask.configuration.windowConfiguration.getWindowingMode()
|
||||
!= WINDOWING_MODE_FULLSCREEN) {
|
||||
|
||||
@@ -2208,7 +2208,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
}
|
||||
|
||||
boolean isResizeable() {
|
||||
return ActivityInfo.isResizeableMode(info.resizeMode) || info.supportsPictureInPicture();
|
||||
return mAtmService.mForceResizableActivities
|
||||
|| ActivityInfo.isResizeableMode(info.resizeMode)
|
||||
|| info.supportsPictureInPicture();
|
||||
}
|
||||
|
||||
/** @return whether this activity is non-resizeable or forced to be resizeable */
|
||||
|
||||
@@ -939,14 +939,15 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
|
||||
/** Sets the original intent, _without_ updating the calling uid or package. */
|
||||
private void setIntent(Intent _intent, ActivityInfo info) {
|
||||
final boolean isLeaf = isLeafTask();
|
||||
if (intent == null) {
|
||||
mNeverRelinquishIdentity =
|
||||
(info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
|
||||
} else if (mNeverRelinquishIdentity) {
|
||||
} else if (mNeverRelinquishIdentity && isLeaf) {
|
||||
return;
|
||||
}
|
||||
|
||||
affinity = isLeafTask() ? info.taskAffinity : null;
|
||||
affinity = isLeaf ? info.taskAffinity : null;
|
||||
if (intent == null) {
|
||||
// If this task already has an intent associated with it, don't set the root
|
||||
// affinity -- we don't want it changing after initially set, but the initially
|
||||
@@ -3587,6 +3588,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
final Task top = getTopMostTask();
|
||||
info.resizeMode = top != null ? top.mResizeMode : mResizeMode;
|
||||
info.topActivityType = top.getActivityType();
|
||||
info.isResizeable = isResizeable();
|
||||
|
||||
ActivityRecord rootActivity = top.getRootActivity();
|
||||
if (rootActivity == null || rootActivity.pictureInPictureArgs.empty()) {
|
||||
|
||||
@@ -455,7 +455,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
|
||||
task.fillTaskInfo(mTmpTaskInfo);
|
||||
boolean changed = lastInfo == null
|
||||
|| mTmpTaskInfo.topActivityType != lastInfo.topActivityType
|
||||
|| mTmpTaskInfo.isResizable() != lastInfo.isResizable()
|
||||
|| mTmpTaskInfo.isResizeable != lastInfo.isResizeable
|
||||
|| mTmpTaskInfo.pictureInPictureParams != lastInfo.pictureInPictureParams
|
||||
|| !TaskDescription.equals(mTmpTaskInfo.taskDescription, lastInfo.taskDescription);
|
||||
if (!changed) {
|
||||
|
||||
Reference in New Issue
Block a user