summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-05-20 17:12:39 -0700
committerTyler Gunn <tgunn@google.com>2015-12-06 22:05:04 -0800
commit7e1a342c0711016fd83801116fa4f60d6c2ddb0a (patch)
tree06d1037fd2b783a63092a75362108d6fa63f21d2 /InCallUI
parent9ae451c42fac9257a2254d64ffbe6f60cdd97fd6 (diff)
Cannot accept video call request from another InCallService.
If another InCallService accepts an incoming video request, the incall UI will not dismiss the glowpad, even those the call upgrades to video. To correct this, added code in InCall.Call to detect changes to the video state and set the SessionModificationState to "NO_REQUEST" should a change occur while the call is in a RECEIVED_UPGRADE_TO_VIDEO_REQUEST state. This causes the glowpad and notification to dismiss. Bug: 20958105 Change-Id: Id87c323b8b9defd674b49ce1ee9c2ad1a9a28341
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 7b2724a37..e866b4b63 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -364,6 +364,8 @@ public class Call {
private int mSessionModificationState;
private final List<String> mChildCallIds = new ArrayList<>();
private final VideoSettings mVideoSettings = new VideoSettings();
+ private int mVideoState;
+
/**
* mModifyToVideoState is used to store requested upgrade / downgrade video state
*/
@@ -435,6 +437,7 @@ public class Call {
if (mState != State.BLOCKED) {
setState(translatedState);
setDisconnectCause(mTelecomCall.getDetails().getDisconnectCause());
+ maybeCancelVideoUpgrade(mTelecomCall.getDetails().getVideoState());
}
if (mTelecomCall.getVideoCall() != null) {
@@ -523,6 +526,23 @@ public class Call {
}
}
+ /**
+ * Determines if a received upgrade to video request should be cancelled. This can happen if
+ * another InCall UI responds to the upgrade to video request.
+ *
+ * @param newVideoState The new video state.
+ */
+ private void maybeCancelVideoUpgrade(int newVideoState) {
+ boolean isVideoStateChanged = mVideoState != newVideoState;
+
+ if (mSessionModificationState == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST
+ && isVideoStateChanged) {
+
+ Log.v(this, "maybeCancelVideoUpgrade : cancelling upgrade notification");
+ setSessionModificationState(SessionModificationState.NO_REQUEST);
+ }
+ mVideoState = newVideoState;
+ }
private static int translateState(int state) {
switch (state) {
case android.telecom.Call.STATE_NEW:
@@ -753,12 +773,6 @@ public class Call {
* when an upgrade request has been completed or failed.
*/
public void setSessionModificationState(int state) {
- if (state == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) {
- Log.e(this,
- "setSessionModificationState not valid for RECEIVED_UPGRADE_TO_VIDEO_REQUEST");
- return;
- }
-
boolean hasChanged = mSessionModificationState != state;
mSessionModificationState = state;
Log.d(this, "setSessionModificationState " + state + " mSessionModificationState="