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

Commit 42b5b78b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove check that system rotation must be allowed for recents rotation...

Merge "Remove check that system rotation must be allowed for recents rotation to be allowed." into sc-v2-dev
parents 9fe8109b da71f412
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
@@ -117,7 +117,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;
@@ -1615,7 +1614,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();
@@ -2047,7 +2046,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;
        }
@@ -4676,7 +4675,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);
    }