Remove rotation flag check
There's a race condition between when
the flag is read and when it gets set,
and not registering the listener that
the flag is gating can result in a lot
of bad rotation state.
Fixes: 158592847
Change-Id: Idd78e15669698bb0d057d0b6661ea69bfa5c8202
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index 226c818..4ca4e4c 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -24,7 +24,6 @@
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 @@
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.PAUSE_NOT_DETECTED, "handleOrientationSetup.1");
}
- if (!isFixedRotationTransformEnabled()) {
- return;
- }
+
baseInputConsumer.notifyOrientationSetup();
}
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index f39c176..07aed52 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -23,7 +23,6 @@
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;
@@ -197,10 +196,6 @@
}
private void setupOrientationSwipeHandler() {
- if (!isFixedRotationTransformEnabled()) {
- return;
- }
-
ActivityManagerWrapper.getInstance().registerTaskStackListener(mFrozenTaskListener);
mOnDestroyFrozenTaskRunnable = () -> ActivityManagerWrapper.getInstance()
.unregisterTaskStackListener(mFrozenTaskListener);
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index 922f5ac..7715cca 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -72,8 +72,6 @@
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 @@
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 @@
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 @@
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();
}
@@ -521,14 +508,6 @@
}
}
- /**
- * 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() {