Merge "Improve rotationForActivityInDifferentOrientation." into tm-qpr-dev am: 2c2aeb0941

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

Change-Id: I5104475185a9f988273a749d03d1fe3cb91bf4b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mariia Sandrikova
2023-01-31 12:04:40 +00:00
committed by Automerger Merge Worker

View File

@@ -1710,12 +1710,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
return ROTATION_UNDEFINED; return ROTATION_UNDEFINED;
} }
if (activityOrientation == ActivityInfo.SCREEN_ORIENTATION_BEHIND) { if (activityOrientation == ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
// TODO(b/266280737): Use ActivityRecord#canDefineOrientationForActivitiesAbove
final ActivityRecord nextCandidate = getActivity( final ActivityRecord nextCandidate = getActivity(
a -> a.getOverrideOrientation() != SCREEN_ORIENTATION_UNSET a -> a.canDefineOrientationForActivitiesAbove() /* callback */,
&& a.getOverrideOrientation() r /* boundary */, false /* includeBoundary */, true /* traverseTopToBottom */);
!= ActivityInfo.SCREEN_ORIENTATION_BEHIND,
r, false /* includeBoundary */, true /* traverseTopToBottom */);
if (nextCandidate != null) { if (nextCandidate != null) {
r = nextCandidate; r = nextCandidate;
} }