From 4a22adba986be3b76b7607f320906729a511b6b4 Mon Sep 17 00:00:00 2001 From: wangqi Date: Mon, 18 Jun 2018 13:18:06 -0700 Subject: Fix wrong orientation change when a video call ends When video call is disconnected, VideoCallPresenter#checkForOrientationAllowedChange is invoked with "Call(= null)". When Call is null, set "DISALLOW" to Activity#setAllowOrientationChange. It causes that the end call screen is displayed in portrait mode even if in landscape mode. This is an upstream change: https://android-review.googlesource.com/c/platform/packages/apps/Dialer/+/694787 Bug: 80375554 Test: manual PiperOrigin-RevId: 201046687 Change-Id: Id08db0e399e067bd85ae44444de3e78aae14f67d --- java/com/android/incallui/VideoCallPresenter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java index 88713f48d..5bdcd7a73 100644 --- a/java/com/android/incallui/VideoCallPresenter.java +++ b/java/com/android/incallui/VideoCallPresenter.java @@ -691,8 +691,12 @@ public class VideoCallPresenter } private void checkForOrientationAllowedChange(@Nullable DialerCall call) { - InCallPresenter.getInstance() - .setInCallAllowsOrientationChange(isVideoCall(call) || isVideoUpgrade(call)); + // Call could be null when video call ended. This check could prevent unwanted orientation + // change before incall UI gets destroyed. + if (call != null) { + InCallPresenter.getInstance() + .setInCallAllowsOrientationChange(isVideoCall(call) || isVideoUpgrade(call)); + } } private void updateFullscreenAndGreenScreenMode( -- cgit v1.2.3