Merge "Enable RotationWatcher when home rotation is on" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-06-01 20:33:30 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 3 deletions
@@ -1039,6 +1039,11 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
private void animateRecentsRotationInPlace(int newRotation) {
if (mOrientationState.canLauncherRotate()) {
// Update the rotation but let system take care of the rotation animation
setLayoutRotation(newRotation, mOrientationState.getDisplayRotation());
return;
}
AnimatorSet pa = setRecentsChangedOrientation(true);
pa.addListener(AnimationSuccessListener.forRunnable(() -> {
setLayoutRotation(newRotation, mOrientationState.getDisplayRotation());
@@ -208,7 +208,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
mDisplayRotation = displayRotation;
mTouchRotation = touchRotation;
if (mLauncherRotation == mTouchRotation) {
if (mLauncherRotation == mTouchRotation || canLauncherRotate()) {
mOrientationHandler = PagedOrientationHandler.HOME_ROTATED;
if (DEBUG) {
Log.d(TAG, "current RecentsOrientedState: " + this);
@@ -240,7 +240,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
private void setFlag(int mask, boolean enabled) {
boolean wasRotationEnabled = !TestProtocol.sDisableSensorRotation
&& mFlags == VALUE_ROTATION_WATCHER_ENABLED;
&& (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED;
if (enabled) {
mFlags |= mask;
} else {
@@ -248,7 +248,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
}
boolean isRotationEnabled = !TestProtocol.sDisableSensorRotation
&& mFlags == VALUE_ROTATION_WATCHER_ENABLED;
&& (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED;
if (wasRotationEnabled != isRotationEnabled) {
UI_HELPER_EXECUTOR.execute(() -> {
if (isRotationEnabled) {