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