Merge "Remove Task#mForceNotOrganized" into sc-v2-dev am: d3811d8874

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

Change-Id: Iff0d37aae88d99de7c12d7949d22bb32fa5a9f59
This commit is contained in:
Riddle Hsu
2021-08-19 23:23:05 +00:00
committed by Automerger Merge Worker
3 changed files with 9 additions and 33 deletions

View File

@@ -7076,7 +7076,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return; return;
} }
mDisplayContent.mPinnedTaskController.onCancelFixedRotationTransform(task); mDisplayContent.mPinnedTaskController.onCancelFixedRotationTransform();
// Perform rotation animation according to the rotation of this activity. // Perform rotation animation according to the rotation of this activity.
startFreezingScreen(originalDisplayRotation); startFreezingScreen(originalDisplayRotation);
// This activity may relaunch or perform configuration change so once it has reported drawn, // This activity may relaunch or perform configuration change so once it has reported drawn,

View File

@@ -319,15 +319,11 @@ class PinnedTaskController {
} }
/** Resets the states which were used to perform fixed rotation with PiP task. */ /** Resets the states which were used to perform fixed rotation with PiP task. */
void onCancelFixedRotationTransform(Task task) { void onCancelFixedRotationTransform() {
mFreezingTaskConfig = false; mFreezingTaskConfig = false;
mDeferOrientationChanging = false; mDeferOrientationChanging = false;
mDestRotatedBounds = null; mDestRotatedBounds = null;
mPipTransaction = null; mPipTransaction = null;
if (!task.isOrganized()) {
// Force clearing Task#mForceNotOrganized because the display didn't rotate.
task.onConfigurationChanged(task.getParent().getConfiguration());
}
} }
/** /**

View File

@@ -590,16 +590,6 @@ class Task extends TaskFragment {
// false. // false.
private boolean mDeferTaskAppear; private boolean mDeferTaskAppear;
/**
* Forces this task to be unorganized. Currently it is used for deferring the control of
* organizer when windowing mode is changing from PiP to fullscreen with orientation change.
* It is true only during Task#setWindowingMode ~ DisplayRotation#continueRotation.
*
* TODO(b/179235349): Remove this field by making surface operations from task organizer sync
* with display rotation.
*/
private boolean mForceNotOrganized;
// Tracking cookie for the creation of this task. // Tracking cookie for the creation of this task.
IBinder mLaunchCookie; IBinder mLaunchCookie;
@@ -1932,19 +1922,16 @@ class Task extends TaskFragment {
} }
} }
if (pipChanging) { if (pipChanging && wasInPictureInPicture) {
// If the top activity is using fixed rotation, it should be changing from PiP to // If the top activity is changing from PiP to fullscreen with fixed rotation,
// fullscreen with display orientation change. Do not notify fullscreen task organizer // clear the crop and rotation matrix of task because fixed rotation will handle
// because the restoration of task surface and the transformation of activity surface // the transformation on activity level. This also avoids flickering caused by the
// need to be done synchronously. // latency of fullscreen task organizer configuring the surface.
final ActivityRecord r = topRunningActivity(); final ActivityRecord r = topRunningActivity();
if (r != null && mDisplayContent.isFixedRotationLaunchingApp(r)) { if (r != null && mDisplayContent.isFixedRotationLaunchingApp(r)) {
mForceNotOrganized = true; getSyncTransaction().setWindowCrop(mSurfaceControl, null)
.setMatrix(mSurfaceControl, Matrix.IDENTITY_MATRIX, new float[9]);
} }
} else {
// If the display orientation change is done, let the corresponding task organizer take
// back the control of this task.
mForceNotOrganized = false;
} }
saveLaunchingStateIfNeeded(); saveLaunchingStateIfNeeded();
@@ -3672,9 +3659,6 @@ class Task extends TaskFragment {
pw.print(" isResizeable="); pw.println(isResizeable()); pw.print(" isResizeable="); pw.println(isResizeable());
pw.print(prefix); pw.print("lastActiveTime="); pw.print(lastActiveTime); pw.print(prefix); pw.print("lastActiveTime="); pw.print(lastActiveTime);
pw.println(" (inactive for " + (getInactiveDuration() / 1000) + "s)"); pw.println(" (inactive for " + (getInactiveDuration() / 1000) + "s)");
if (mForceNotOrganized) {
pw.print(prefix); pw.println("mForceNotOrganized=true");
}
} }
@Override @Override
@@ -4150,9 +4134,6 @@ class Task extends TaskFragment {
} }
private boolean canBeOrganized() { private boolean canBeOrganized() {
if (mForceNotOrganized) {
return false;
}
// All root tasks can be organized // All root tasks can be organized
if (isRootTask()) { if (isRootTask()) {
return true; return true;
@@ -4305,7 +4286,6 @@ class Task extends TaskFragment {
return setTaskOrganizer(null); return setTaskOrganizer(null);
} }
final int windowingMode = getWindowingMode();
final TaskOrganizerController controller = mWmService.mAtmService.mTaskOrganizerController; final TaskOrganizerController controller = mWmService.mAtmService.mTaskOrganizerController;
final ITaskOrganizer organizer = controller.getTaskOrganizer(); final ITaskOrganizer organizer = controller.getTaskOrganizer();
if (!forceUpdate && mTaskOrganizer == organizer) { if (!forceUpdate && mTaskOrganizer == organizer) {