summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2018-06-18 13:18:06 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-18 14:55:14 -0700
commit4a22adba986be3b76b7607f320906729a511b6b4 (patch)
tree3915a53ca34d1b8c141110119a742ab0dc3ede71
parent8916483918c20cfe800501c953680e2bce736ab3 (diff)
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
-rw-r--r--java/com/android/incallui/VideoCallPresenter.java8
1 files changed, 6 insertions, 2 deletions
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(