Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fc75d65 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Remove enabled flag respect_non_top_visible_fixed_orientation" into main

parents 1312d92d cf5c5e31
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -220,13 +220,6 @@ flag {
  }
}

flag {
  name: "respect_non_top_visible_fixed_orientation"
  namespace: "windowing_frontend"
  description: "If top activity is not opaque, respect the fixed orientation of activity behind it"
  bug: "283514860"
}

flag {
  name: "insets_decoupled_configuration"
  namespace: "windowing_frontend"
+6 −22
Original line number Diff line number Diff line
@@ -1781,9 +1781,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     * different fixed orientations will still keep their original appearances.
     */
    void applyFixedRotationForNonTopVisibleActivityIfNeeded() {
        if (!mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
            return;
        }
        final ActivityRecord orientationSrcApp = getLastOrientationSourceApp();
        if (orientationSrcApp == null || orientationSrcApp.fillsParent()) {
            return;
@@ -1807,9 +1804,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     * then the bottom one will apply the fixed rotation transform for its orientation.
     */
    void applyFixedRotationForNonTopVisibleActivityIfNeeded(@NonNull ActivityRecord ar) {
        if (!mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
            return;
        }
        final ActivityRecord orientationSrcApp = getLastOrientationSourceApp();
        if (orientationSrcApp != null) {
            applyFixedRotationForNonTopVisibleActivityIfNeeded(ar,
@@ -1916,8 +1910,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            return false;
        }
        if (r.hasFixedRotationTransform()) {
            if (mWmService.mFlags.mRespectNonTopVisibleFixedOrientation
                    && mFixedRotationLaunchingApp == null) {
            if (mFixedRotationLaunchingApp == null) {
                // It could be finishing the previous top translucent activity, and the next fixed
                // orientation activity becomes the current top.
                setFixedRotationLaunchingAppUnchecked(r,
@@ -1926,18 +1919,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            // It has been set and not yet finished.
            return true;
        }
        if (mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
        if (r.isReportedDrawn()) {
            // It is late for a drawn app. Either this is already a stable state or it needs
            // a rotation animation to handle the change.
            return false;
        }
        } else if (!r.occludesParent() || r.isReportedDrawn()) {
            // While entering or leaving a translucent or floating activity (e.g. dialog style),
            // there is a visible activity in the background. Then it still needs rotation animation
            // to cover the activity configuration change.
            return false;
        }
        if (checkOpening) {
            if (!mTransitionController.isCollecting(r)) {
                // Apply normal rotation animation in case the activity changes requested
@@ -6735,7 +6721,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        final boolean rotationChanged = super.setIgnoreOrientationRequest(ignoreOrientationRequest);
        mWmService.mDisplayWindowSettings.setIgnoreOrientationRequest(
                this, mSetIgnoreOrientationRequest);
        if (ignoreOrientationRequest && mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
        if (ignoreOrientationRequest) {
            forAllActivities(r -> {
                r.finishFixedRotationTransform();
            });
@@ -6971,9 +6957,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                // In most cases this is a no-op if the activity doesn't have fixed rotation.
                // Otherwise it could be from finishing recents animation while the display has
                // different orientation.
                if (!mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
                    r.finishFixedRotationTransform();
                } else if (!r.isVisible()) {
                if (!r.isVisible()) {
                    r.finishFixedRotationTransform();
                }
                return;
+0 −3
Original line number Diff line number Diff line
@@ -338,9 +338,6 @@ class TransparentPolicy {
            if (task == null || task.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
                return false;
            }
            if (!mActivityRecord.mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
                return true;
            }
            // Do not enable the policy if the activity can affect display orientation.
            final int orientation = mActivityRecord.getOverrideOrientation();
            return orientation == SCREEN_ORIENTATION_UNSPECIFIED
+0 −3
Original line number Diff line number Diff line
@@ -50,9 +50,6 @@ class WindowManagerFlags {

    final boolean mInsetsDecoupledConfiguration = Flags.insetsDecoupledConfiguration();

    final boolean mRespectNonTopVisibleFixedOrientation =
            Flags.respectNonTopVisibleFixedOrientation();

    final boolean mAodTransition = Flags.aodTransition();

    final boolean mDispatchFirstKeyguardLockedState = Flags.dispatchFirstKeyguardLockedState();
+0 −1
Original line number Diff line number Diff line
@@ -1752,7 +1752,6 @@ public class DisplayContentTests extends WindowTestsBase {
        assertFalse(mDisplayContent.hasTopFixedRotationLaunchingApp());
    }

    @EnableFlags(com.android.window.flags.Flags.FLAG_RESPECT_NON_TOP_VISIBLE_FIXED_ORIENTATION)
    @Test
    public void testRespectNonTopVisibleFixedOrientation() {
        spyOn(mWm.mAppCompatConfiguration);
Loading