Merge "Respect letterbox config for exiting pip with fixed orientation" into tm-qpr-dev am: 2ef0be2337
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19033645 Change-Id: I939b810317470d0306bdcf6d1c916f63cbe5b7bf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -7813,11 +7813,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
newParentConfiguration.windowConfiguration.getWindowingMode();
|
newParentConfiguration.windowConfiguration.getWindowingMode();
|
||||||
final boolean isFixedOrientationLetterboxAllowed =
|
final boolean isFixedOrientationLetterboxAllowed =
|
||||||
parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
|
parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
|
||||||
|| parentWindowingMode == WINDOWING_MODE_FULLSCREEN;
|
|| parentWindowingMode == WINDOWING_MODE_FULLSCREEN
|
||||||
|
// Switching from PiP to fullscreen.
|
||||||
|
|| (parentWindowingMode == WINDOWING_MODE_PINNED
|
||||||
|
&& resolvedConfig.windowConfiguration.getWindowingMode()
|
||||||
|
== WINDOWING_MODE_FULLSCREEN);
|
||||||
// TODO(b/181207944): Consider removing the if condition and always run
|
// TODO(b/181207944): Consider removing the if condition and always run
|
||||||
// resolveFixedOrientationConfiguration() since this should be applied for all cases.
|
// resolveFixedOrientationConfiguration() since this should be applied for all cases.
|
||||||
if (isFixedOrientationLetterboxAllowed) {
|
if (isFixedOrientationLetterboxAllowed) {
|
||||||
resolveFixedOrientationConfiguration(newParentConfiguration, parentWindowingMode);
|
resolveFixedOrientationConfiguration(newParentConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCompatDisplayInsets != null) {
|
if (mCompatDisplayInsets != null) {
|
||||||
@@ -8109,8 +8113,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
* <p>If letterboxed due to fixed orientation then aspect ratio restrictions are also applied
|
* <p>If letterboxed due to fixed orientation then aspect ratio restrictions are also applied
|
||||||
* in this method.
|
* in this method.
|
||||||
*/
|
*/
|
||||||
private void resolveFixedOrientationConfiguration(@NonNull Configuration newParentConfig,
|
private void resolveFixedOrientationConfiguration(@NonNull Configuration newParentConfig) {
|
||||||
int windowingMode) {
|
|
||||||
mLetterboxBoundsForFixedOrientationAndAspectRatio = null;
|
mLetterboxBoundsForFixedOrientationAndAspectRatio = null;
|
||||||
mIsEligibleForFixedOrientationLetterbox = false;
|
mIsEligibleForFixedOrientationLetterbox = false;
|
||||||
final Rect parentBounds = newParentConfig.windowConfiguration.getBounds();
|
final Rect parentBounds = newParentConfig.windowConfiguration.getBounds();
|
||||||
@@ -8130,11 +8133,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
if (organizedTf != null && !organizedTf.fillsParent()) {
|
if (organizedTf != null && !organizedTf.fillsParent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (windowingMode == WINDOWING_MODE_PINNED) {
|
|
||||||
// PiP bounds have higher priority than the requested orientation. Otherwise the
|
|
||||||
// activity may be squeezed into a small piece.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Rect resolvedBounds =
|
final Rect resolvedBounds =
|
||||||
getResolvedOverrideConfiguration().windowConfiguration.getBounds();
|
getResolvedOverrideConfiguration().windowConfiguration.getBounds();
|
||||||
|
|||||||
@@ -1610,7 +1610,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
|||||||
if (mTransitionController.useShellTransitionsRotation()) {
|
if (mTransitionController.useShellTransitionsRotation()) {
|
||||||
return ROTATION_UNDEFINED;
|
return ROTATION_UNDEFINED;
|
||||||
}
|
}
|
||||||
if (!WindowManagerService.ENABLE_FIXED_ROTATION_TRANSFORM) {
|
if (!WindowManagerService.ENABLE_FIXED_ROTATION_TRANSFORM
|
||||||
|
|| getIgnoreOrientationRequest()) {
|
||||||
return ROTATION_UNDEFINED;
|
return ROTATION_UNDEFINED;
|
||||||
}
|
}
|
||||||
if (r.mOrientation == ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
|
if (r.mOrientation == ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
|
||||||
|
|||||||
@@ -1699,6 +1699,13 @@ public class DisplayContentTests extends WindowTestsBase {
|
|||||||
assertFalse(displayContent.mPinnedTaskController.isFreezingTaskConfig(pinnedTask));
|
assertFalse(displayContent.mPinnedTaskController.isFreezingTaskConfig(pinnedTask));
|
||||||
assertEquals(pinnedActivity.getConfiguration().orientation,
|
assertEquals(pinnedActivity.getConfiguration().orientation,
|
||||||
displayContent.getConfiguration().orientation);
|
displayContent.getConfiguration().orientation);
|
||||||
|
|
||||||
|
// No need to apply rotation if the display ignores orientation request.
|
||||||
|
doCallRealMethod().when(displayContent).rotationForActivityInDifferentOrientation(any());
|
||||||
|
pinnedActivity.mOrientation = SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
|
displayContent.setIgnoreOrientationRequest(true);
|
||||||
|
assertEquals(WindowConfiguration.ROTATION_UNDEFINED,
|
||||||
|
displayContent.rotationForActivityInDifferentOrientation(pinnedActivity));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user