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

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

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

View File

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