From be8c34077cb06da736053926f931c3e4f0be44dc Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 22 May 2019 15:17:52 -0700 Subject: Lock launcher rotation during activity transition to allow proper seamless transition at the end Bug: 131360075 Change-Id: I2b76d4b3e0528e56b7b4709fd3708bc858bf1612 --- src/com/android/launcher3/states/RotationHelper.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/com/android/launcher3/states') diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index 3727fa663..b6c3c35b8 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -62,6 +62,10 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { * Rotation request made by {@link InternalStateHandler}. This supersedes any other request. */ private int mStateHandlerRequest = REQUEST_NONE; + /** + * Rotation request made by an app transition + */ + private int mCurrentTransitionRequest = REQUEST_NONE; /** * Rotation request made by a Launcher State */ @@ -123,6 +127,13 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { } } + public void setCurrentTransitionRequest(int request) { + if (mCurrentTransitionRequest != request) { + mCurrentTransitionRequest = request; + notifyChange(); + } + } + public void setCurrentStateRequest(int request) { if (mCurrentStateRequest != request) { mCurrentStateRequest = request; @@ -163,6 +174,9 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { if (mStateHandlerRequest != REQUEST_NONE) { activityFlags = mStateHandlerRequest == REQUEST_LOCK ? SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED; + } else if (mCurrentTransitionRequest != REQUEST_NONE) { + activityFlags = mCurrentTransitionRequest == REQUEST_LOCK ? + SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED; } else if (mCurrentStateRequest == REQUEST_LOCK) { activityFlags = SCREEN_ORIENTATION_LOCKED; } else if (mIgnoreAutoRotateSettings || mCurrentStateRequest == REQUEST_ROTATE -- cgit v1.2.3