IMS-VT: Use correct video state when accepting the request

To accept session modification request UI needs to reply
with the video state provided in the incoming session
modification request. Current implemenation accepts all
incoming session modification requests by replying with
hard coded bidirectional video state which fails at
the lower layers.

BUG=28917534
Change-Id: If3e51bcc1b7a8a122cffaf28d524c3df24b1c1dd
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 2d1fbca..5f3fb35 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -923,6 +923,19 @@
         }
     }
 
+    public void acceptUpgradeRequest(Context context) {
+        if (mCallList == null) {
+            StatusBarNotifier.clearAllCallNotifications(context);
+            Log.e(this, " acceptUpgradeRequest mCallList is empty so returning");
+            return;
+        }
+
+        Call call = mCallList.getVideoUpgradeRequestCall();
+        if (call != null) {
+            acceptUpgradeRequest(call.getRequestedVideoState(), context);
+        }
+    }
+
     public void acceptUpgradeRequest(int videoState, Context context) {
         Log.d(this, " acceptUpgradeRequest videoState " + videoState);
         // Bail if we have been shut down and the call list is null.
diff --git a/InCallUI/src/com/android/incallui/NotificationBroadcastReceiver.java b/InCallUI/src/com/android/incallui/NotificationBroadcastReceiver.java
index f6d1cf4..6fb3ff8 100644
--- a/InCallUI/src/com/android/incallui/NotificationBroadcastReceiver.java
+++ b/InCallUI/src/com/android/incallui/NotificationBroadcastReceiver.java
@@ -65,9 +65,7 @@
         } else if (action.equals(ACTION_HANG_UP_ONGOING_CALL)) {
             InCallPresenter.getInstance().hangUpOngoingCall(context);
         } else if (action.equals(ACTION_ACCEPT_VIDEO_UPGRADE_REQUEST)) {
-            //TODO: Change calltype after adding support for TX and RX
-            InCallPresenter.getInstance().acceptUpgradeRequest(
-                    VideoProfile.STATE_BIDIRECTIONAL, context);
+            InCallPresenter.getInstance().acceptUpgradeRequest(context);
         } else if (action.equals(ACTION_DECLINE_VIDEO_UPGRADE_REQUEST)) {
             InCallPresenter.getInstance().declineUpgradeRequest(context);
         }