summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/InCallPresenter.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-02-17 15:18:36 -0800
committerTyler Gunn <tgunn@google.com>2016-02-18 10:42:35 -0800
commit207029be4c95b6d66ef4bd3c2277a9ba9e0c62a1 (patch)
tree10dc904dcea1917bdfcca362f7684ffaa7905e92 /InCallUI/src/com/android/incallui/InCallPresenter.java
parent9172c905b311816eba1d24659f02facfab95b0b3 (diff)
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
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallPresenter.java')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index f50da8dbd..c51a561bf 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -78,7 +78,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* TODO: This class has become more of a state machine at this point. Consider renaming.
*/
public class InCallPresenter implements CallList.Listener,
- CircularRevealFragment.OnCircularRevealCompleteListener {
+ CircularRevealFragment.OnCircularRevealCompleteListener,
+ InCallVideoCallCallbackNotifier.SessionModificationListener {
private static final String EXTRA_FIRST_TIME_SHOWN =
"com.android.incallui.intent.extra.FIRST_TIME_SHOWN";
@@ -387,6 +388,7 @@ public class InCallPresenter implements CallList.Listener,
mCallList.addListener(this);
VideoPauseController.getInstance().setUp(this);
+ InCallVideoCallCallbackNotifier.getInstance().addSessionModificationListener(this);
mFilteredQueryHandler = new FilteredNumberAsyncQueryHandler(context.getContentResolver());
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
@@ -413,6 +415,7 @@ public class InCallPresenter implements CallList.Listener,
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
VideoPauseController.getInstance().tearDown();
+ InCallVideoCallCallbackNotifier.getInstance().removeSessionModificationListener(this);
}
private void attemptFinishActivity() {
@@ -726,6 +729,17 @@ public class InCallPresenter implements CallList.Listener,
}
}
+ @Override
+ public void onUpgradeToVideoRequest(Call call, int videoState) {
+ Log.d(this, "onUpgradeToVideoRequest call = " + call + " video state = " + videoState);
+
+ if (call == null) {
+ return;
+ }
+
+ call.setRequestedVideoState(videoState);
+ }
+
/**
* Given the call list, return the state in which the in-call screen should be.
*/
@@ -980,6 +994,14 @@ public class InCallPresenter implements CallList.Listener,
}
}
+ /*package*/
+ void declineUpgradeRequest() {
+ // Pass mContext if InCallActivity is destroyed.
+ // Ex: When user pressed back key while in active call and
+ // then modify request is received followed by MT call.
+ declineUpgradeRequest(mInCallActivity != null ? mInCallActivity : mContext);
+ }
+
/**
* Returns true if the incall app is the foreground application.
*/