From 207029be4c95b6d66ef4bd3c2277a9ba9e0c62a1 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 17 Feb 2016 15:18:36 -0800 Subject: IMS-VT: Moving upgradeVideoRequest handling to InCallPresenter When user pressed back key InCallActviity will be destroyed and corresponding listeners in VideoCallPresenter will be removed. Due to this we are unable to process the upgrade request. Moving handling of upgrade Video Call request handling from VideoCallPresenter to InCallPresenter as InCallPresenter will be available even InCallActivity is destroyed. Bug: 27130345 Change-Id: Idbd3348cea9d712c8391319d091642d1fd60964f --- .../android/incallui/InCallVideoCallCallback.java | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'InCallUI/src/com/android/incallui/InCallVideoCallCallback.java') diff --git a/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java b/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java index 76f8c09fc..99e6d5129 100644 --- a/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java +++ b/InCallUI/src/com/android/incallui/InCallVideoCallCallback.java @@ -55,10 +55,8 @@ public class InCallVideoCallCallback extends VideoCall.Callback { boolean wasVideoCall = VideoUtils.isVideoCall(previousVideoState); boolean isVideoCall = VideoUtils.isVideoCall(newVideoState); - // Check for upgrades to video and downgrades to audio. - if (wasVideoCall && !isVideoCall) { - InCallVideoCallCallbackNotifier.getInstance().downgradeToAudio(mCall); - } else if (previousVideoState != newVideoState) { + // Check for upgrades to video. + if (!wasVideoCall && isVideoCall && previousVideoState != newVideoState) { InCallVideoCallCallbackNotifier.getInstance().upgradeToVideoRequest(mCall, newVideoState); } @@ -93,21 +91,8 @@ public class InCallVideoCallCallback extends VideoCall.Callback { Call.SessionModificationState.REQUEST_FAILED); } } - InCallVideoCallCallbackNotifier.getInstance().upgradeToVideoFail(status, mCall); - } else if (requestedProfile != null && responseProfile != null) { - boolean modifySucceeded = requestedProfile.getVideoState() == - responseProfile.getVideoState(); - boolean isVideoCall = VideoUtils.isVideoCall(responseProfile.getVideoState()); - if (modifySucceeded && isVideoCall) { - InCallVideoCallCallbackNotifier.getInstance().upgradeToVideoSuccess(mCall); - } else if (!modifySucceeded && isVideoCall) { - InCallVideoCallCallbackNotifier.getInstance().upgradeToVideoFail(status, mCall); - } else if (modifySucceeded && !isVideoCall) { - InCallVideoCallCallbackNotifier.getInstance().downgradeToAudio(mCall); - } - } else { - Log.d(this, "onSessionModifyResponseReceived request and response Profiles are null"); } + // Finally clear the outstanding request. mCall.setSessionModificationState(Call.SessionModificationState.NO_REQUEST); } -- cgit v1.2.3