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

Commit 158cbbfe authored by Vinit Nayak's avatar Vinit Nayak Committed by Automerger Merge Worker
Browse files

Remove rotation flag check am: 2b515c70

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/11815828

Change-Id: Ied328efa8f43520439ecddc458d3df0d25544d5b
parents 433d8ca0 2b515c70
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TI
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE;
import static com.android.quickstep.util.RecentsOrientedState.isFixedRotationTransformEnabled;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_INPUT_MONITOR;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED;
@@ -636,9 +635,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "handleOrientationSetup.1");
        }
        if (!isFixedRotationTransformEnabled()) {
            return;
        }

        baseInputConsumer.notifyOrientationSetup();
    }

+0 −5
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON;
import static com.android.quickstep.SysUINavigationMode.Mode.THREE_BUTTONS;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
import static com.android.quickstep.util.RecentsOrientedState.isFixedRotationTransformEnabled;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED;
@@ -196,10 +195,6 @@ public class RecentsAnimationDeviceState implements
    }

    private void setupOrientationSwipeHandler() {
        if (!isFixedRotationTransformEnabled()) {
            return;
        }

        ActivityManagerWrapper.getInstance().registerTaskStackListener(mFrozenTaskListener);
        mOnDestroyFrozenTaskRunnable = () -> ActivityManagerWrapper.getInstance()
                .unregisterTaskStackListener(mFrozenTaskListener);
+7 −28
Original line number Diff line number Diff line
@@ -72,8 +72,6 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
    private static final String TAG = "RecentsOrientedState";
    private static final boolean DEBUG = true;

    private static final String FIXED_ROTATION_TRANSFORM_SETTING_NAME = "fixed_rotation_transform";

    private ContentObserver mSystemAutoRotateObserver = new ContentObserver(new Handler()) {
        @Override
        public void onChange(boolean selfChange) {
@@ -94,25 +92,22 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
    private static final int FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_ACTIVITY = 1 << 0;
    // Multiple orientation is only supported if density is < 600
    private static final int FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_DENSITY = 1 << 1;
    // Feature flag controlling the multi-orientation feature
    private static final int FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_FLAG = 1 << 2;
    // Shared prefs for rotation, only if activity supports it
    private static final int FLAG_HOME_ROTATION_ALLOWED_IN_PREFS = 1 << 3;
    private static final int FLAG_HOME_ROTATION_ALLOWED_IN_PREFS = 1 << 2;
    // If the user has enabled system rotation
    private static final int FLAG_SYSTEM_ROTATION_ALLOWED = 1 << 4;
    private static final int FLAG_SYSTEM_ROTATION_ALLOWED = 1 << 3;
    // Multiple orientation is not supported in multiwindow mode
    private static final int FLAG_MULTIWINDOW_ROTATION_ALLOWED = 1 << 5;
    private static final int FLAG_MULTIWINDOW_ROTATION_ALLOWED = 1 << 4;
    // Whether to rotation sensor is supported on the device
    private static final int FLAG_ROTATION_WATCHER_SUPPORTED = 1 << 6;
    private static final int FLAG_ROTATION_WATCHER_SUPPORTED = 1 << 5;
    // Whether to enable rotation watcher when multi-rotation is supported
    private static final int FLAG_ROTATION_WATCHER_ENABLED = 1 << 7;
    private static final int FLAG_ROTATION_WATCHER_ENABLED = 1 << 6;
    // Enable home rotation for UI tests, ignoring home rotation value from prefs
    private static final int FLAG_HOME_ROTATION_FORCE_ENABLED_FOR_TESTING = 1 << 8;
    private static final int FLAG_HOME_ROTATION_FORCE_ENABLED_FOR_TESTING = 1 << 7;

    private static final int MASK_MULTIPLE_ORIENTATION_SUPPORTED_BY_DEVICE =
            FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_ACTIVITY
            | FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_DENSITY
            | FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_FLAG;
            | FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_DENSITY;

    // State for which rotation watcher will be enabled. We skip it when home rotation or
    // multi-window is enabled as in that case, activity itself rotates.
@@ -123,9 +118,6 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
    private SysUINavigationMode.NavigationModeChangeListener mNavModeChangeListener =
            newMode -> setFlag(FLAG_ROTATION_WATCHER_SUPPORTED, newMode != TWO_BUTTONS);

    /** TODO: Remove once R ships. This is unlikely to change across different swipe gestures. */
    private static boolean sFixedRotationEnabled;

    private final Context mContext;
    private final ContentResolver mContentResolver;
    private final SharedPreferences mSharedPrefs;
@@ -168,11 +160,6 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
        if (originalSmallestWidth < 600) {
            mFlags |= FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_DENSITY;
        }
        sFixedRotationEnabled = Settings.Global.getInt(
                context.getContentResolver(), FIXED_ROTATION_TRANSFORM_SETTING_NAME, 1) == 1;
        if (sFixedRotationEnabled) {
            mFlags |= FLAG_MULTIPLE_ORIENTATION_SUPPORTED_BY_FLAG;
        }
        initFlags();
    }

@@ -520,14 +507,6 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
        }
    }

    /**
     * Returns true if system can keep Launcher fixed to portrait layout even if the
     * foreground app is rotated
     */
    public static boolean isFixedRotationTransformEnabled() {
        return sFixedRotationEnabled;
    }

    @NonNull
    @Override
    public String toString() {