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

Commit da71f412 authored by Pat Manning's avatar Pat Manning
Browse files

Remove check that system rotation must be allowed for recents rotation

to be allowed.

This check existed before the user was able to rotate via the rotation
button while autorotate setting is off.

Test: manual
Fix: 201511975
Change-Id: I920886cb42ec5b8f4d3eb0bdd80b216cd7c3c849
parent c1359c44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public class GoOverviewActionsView extends OverviewActionsView<OverlayUICallback
     */
    public void updateOrientationState(RecentsOrientedState orientedState) {
        // dismiss tooltip
        boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
        boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
        if (mArrowTipView != null && !canLauncherRotate) {
            mArrowTipView.close(/* animate= */ false);
        }
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
            }
        }
        RecentsOrientedState orientedState = taskView.getRecentsView().getPagedViewOrientedState();
        boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
        boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
        boolean isInLandscape = orientedState.getTouchRotation() != ROTATION_0;

        // Add overview actions to the menu when in in-place rotate landscape mode.
+4 −11
Original line number Diff line number Diff line
@@ -218,8 +218,8 @@ public class RecentsOrientedState implements

    private boolean updateHandler() {
        mRecentsActivityRotation = inferRecentsActivityRotation(mDisplayRotation);
        if (mRecentsActivityRotation == mTouchRotation
                || (canRecentsActivityRotate() && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
        if (mRecentsActivityRotation == mTouchRotation || (isRecentsActivityRotationAllowed()
                && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
            mOrientationHandler = PagedOrientationHandler.PORTRAIT;
        } else if (mTouchRotation == ROTATION_90) {
            mOrientationHandler = PagedOrientationHandler.LANDSCAPE;
@@ -253,7 +253,7 @@ public class RecentsOrientedState implements
    private boolean setFlag(int mask, boolean enabled) {
        boolean wasRotationEnabled = !TestProtocol.sDisableSensorRotation
                && (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
                && !canRecentsActivityRotate();
                && !isRecentsActivityRotationAllowed();
        if (enabled) {
            mFlags |= mask;
        } else {
@@ -262,7 +262,7 @@ public class RecentsOrientedState implements

        boolean isRotationEnabled = !TestProtocol.sDisableSensorRotation
                && (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
                && !canRecentsActivityRotate();
                && !isRecentsActivityRotationAllowed();
        if (wasRotationEnabled != isRotationEnabled) {
            UI_HELPER_EXECUTOR.execute(() -> {
                if (isRotationEnabled) {
@@ -375,13 +375,6 @@ public class RecentsOrientedState implements
                        | FLAG_HOME_ROTATION_FORCE_ENABLED_FOR_TESTING)) != 0;
    }

    /**
     * Returns true if the activity can rotate, if allowed by system rotation settings
     */
    public boolean canRecentsActivityRotate() {
        return (mFlags & FLAG_SYSTEM_ROTATION_ALLOWED) != 0 && isRecentsActivityRotationAllowed();
    }

    /**
     * Enables or disables the rotation watcher for listening to rotation callbacks
     */
+3 −4
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.PagedView;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
@@ -1612,7 +1611,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
                || mOrientationState.getRecentsActivityRotation() != ROTATION_0;
        mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
                !mOrientationState.canRecentsActivityRotate() && isInLandscape);
                !mOrientationState.isRecentsActivityRotationAllowed() && isInLandscape);

        // Update TaskView's DeviceProfile dependent layout.
        updateChildTaskOrientations();
@@ -2044,7 +2043,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    }

    private void animateRecentsRotationInPlace(int newRotation) {
        if (mOrientationState.canRecentsActivityRotate()) {
        if (mOrientationState.isRecentsActivityRotationAllowed()) {
            // Let system take care of the rotation
            return;
        }
@@ -4666,7 +4665,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            getCurrentPageTaskView().setModalness(modalness);
        }
        // Only show actions view when it's modal for in-place landscape mode.
        boolean inPlaceLandscape = !mOrientationState.canRecentsActivityRotate()
        boolean inPlaceLandscape = !mOrientationState.isRecentsActivityRotationAllowed()
                && mOrientationState.getTouchRotation() != ROTATION_0;
        mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, modalness < 1 && inPlaceLandscape);
    }