summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorSekine Yasuaki <yasuaki.sekine@sony.com>2019-04-16 17:25:07 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-16 17:25:07 -0700
commit51dc2a559fd4b0cb4899affe9a7e8816d4f45e3d (patch)
tree689bfae557fe6bb0380b6f92c5cb0e6bcf78447f /java
parent6f53dbc5d9b0313286fb14e5d272c7fe09bca4e1 (diff)
parent96026df419a9203ac2a2ba0ed6a7a41ddf2458e2 (diff)
Merge "Fix to update peer dimensions when video screen resumes foreground" am: 91bf209306 am: ea194aec1e
am: 96026df419 Change-Id: I97e5f8f3dacac16b4a1ae6e5140af486a011372b
Diffstat (limited to 'java')
-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 1f4e49ad8..f9afd2d54 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
@@ -386,6 +388,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,
@@ -1558,6 +1562,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);
}
@@ -1974,4 +1980,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;
+ }
}