Disabling seamless rotation in multiwindow mode

Bug: 133765491
Change-Id: If68c709fa5b8216d63fc516f16f03bf2aa83172a
This commit is contained in:
Sunny Goyal
2019-05-30 10:31:09 -07:00
parent f07cf179dc
commit da14cf8b9f
2 changed files with 10 additions and 6 deletions
+2 -3
View File
@@ -490,9 +490,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize);
}
if (supportsFakeLandscapeUI()
&& mDeviceProfile.isVerticalBarLayout()
&& !mDeviceProfile.isMultiWindowMode) {
if (supportsFakeLandscapeUI() && mDeviceProfile.isVerticalBarLayout()) {
mStableDeviceProfile = mDeviceProfile.inv.portraitProfile;
mRotationMode = UiFactory.getRotationMode(mDeviceProfile);
} else {
@@ -500,6 +498,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mRotationMode = RotationMode.NORMAL;
}
mRotationHelper.updateRotationAnimation();
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getWallpaperDeviceProfile().isVerticalBarLayout(), true);
}
@@ -94,16 +94,20 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
public boolean homeScreenCanRotate() {
return mIgnoreAutoRotateSettings || mAutoRotateEnabled
|| mStateHandlerRequest != REQUEST_NONE;
|| mStateHandlerRequest != REQUEST_NONE
|| mLauncher.getDeviceProfile().isMultiWindowMode;
}
private void updateRotationAnimation() {
public void updateRotationAnimation() {
if (FeatureFlags.FAKE_LANDSCAPE_UI.get()) {
WindowManager.LayoutParams lp = mLauncher.getWindow().getAttributes();
int oldAnim = lp.rotationAnimation;
lp.rotationAnimation = homeScreenCanRotate()
? WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE
: WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;
mLauncher.getWindow().setAttributes(lp);
if (oldAnim != lp.rotationAnimation) {
mLauncher.getWindow().setAttributes(lp);
}
}
}
@@ -123,6 +127,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
public void setStateHandlerRequest(int request) {
if (mStateHandlerRequest != request) {
mStateHandlerRequest = request;
updateRotationAnimation();
notifyChange();
}
}