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
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index 88713f4..5bdcd7a 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -691,8 +691,12 @@
}
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(