summaryrefslogtreecommitdiffstats
path: root/java/com
diff options
context:
space:
mode:
authorSekine Yasuaki <yasuaki.sekine@sony.com>2017-07-04 16:50:09 +0900
committerMichael Bestas <mkbestas@lineageos.org>2020-05-24 20:09:49 +0300
commite7523ef16127591c61943de822fb15806709fc9a (patch)
tree2c8a551eaf6ea67206d0877f6a9468679edc7fbb /java/com
parent03a214c79bf5670439dde73c73e7166e38ec8981 (diff)
downloadandroid_packages_apps_Dialer-e7523ef16127591c61943de822fb15806709fc9a.tar.gz
android_packages_apps_Dialer-e7523ef16127591c61943de822fb15806709fc9a.tar.bz2
android_packages_apps_Dialer-e7523ef16127591c61943de822fb15806709fc9a.zip
Fix to update peer dimensions when video screen resumes foreground
[Issue/Cause of defect] If partner device is rotated during video screen of target device is in background, and then resumes to foreground, partner image will be shown with incorrect dimensions. Because when video screen goes to background, VideoCallPresenter stops checking CVO(Coordination of Video Orientation) of partner device. And when video screen is resumed to foreground, there is no logic to update partner image with latest peer dimensions. [How to fix] Even if video screen is in background, CVO(peer dimensions) is notified to DialerCall. Therefore DialerCall should store the dimensions. And when video screen resumes to fore, VideoCallPresenter should update the screen with correct(latest) peer dimensions. Test: manual - Checked that the partner image is shown with correct dimensions. Bug: 111575038 Change-Id: I32ff5407f1222b232b47a35e7083a473be67b468
Diffstat (limited to 'java/com')
-rw-r--r--java/com/android/incallui/VideoCallPresenter.java11
-rw-r--r--java/com/android/incallui/call/DialerCall.java16
2 files changed, 27 insertions, 0 deletions
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index 5bdcd7a73..1700d530d 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -323,6 +323,17 @@ public class VideoCallPresenter
InCallPresenter.InCallState inCallState = InCallPresenter.getInstance().getInCallState();
onStateChange(inCallState, inCallState, CallList.getInstance());
isVideoCallScreenUiReady = true;
+
+ Point sourceVideoDimensions = getRemoteVideoSurfaceTexture().getSourceVideoDimensions();
+ if (sourceVideoDimensions != null && primaryCall != null) {
+ int width = primaryCall.getPeerDimensionWidth();
+ int height = primaryCall.getPeerDimensionHeight();
+ boolean updated = DialerCall.UNKNOWN_PEER_DIMENSIONS != width
+ && DialerCall.UNKNOWN_PEER_DIMENSIONS != height;
+ if (updated && (sourceVideoDimensions.x != width || sourceVideoDimensions.y != height)) {
+ onUpdatePeerDimensions(primaryCall, width, height);
+ }
+ }
}
/** Called when the user interface is no longer ready to be used. */
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index 07cfe3f8f..06bd9260e 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -126,6 +126,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
private static int idCounter = 0;
+ public static final int UNKNOWN_PEER_DIMENSIONS = -1;
+
/**
* A counter used to append to restricted/private/hidden calls so that users can identify them in
* a conversation. This value is reset in {@link CallList#onCallRemoved(Context, Call)} when there
@@ -387,6 +389,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
};
private long timeAddedMs;
+ private int peerDimensionWidth = UNKNOWN_PEER_DIMENSIONS;
+ private int peerDimensionHeight = UNKNOWN_PEER_DIMENSIONS;
public DialerCall(
Context context,
@@ -1565,6 +1569,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
@Override
public void onPeerDimensionsChanged(int width, int height) {
+ peerDimensionWidth = width;
+ peerDimensionHeight = height;
InCallVideoCallCallbackNotifier.getInstance().peerDimensionsChanged(this, width, height);
}
@@ -1981,4 +1987,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
public interface CannedTextResponsesLoadedListener {
void onCannedTextResponsesLoaded(DialerCall call);
}
+
+ /** Gets peer dimension width. */
+ public int getPeerDimensionWidth() {
+ return peerDimensionWidth;
+ }
+
+ /** Gets peer dimension height. */
+ public int getPeerDimensionHeight() {
+ return peerDimensionHeight;
+ }
}