Promotion of atel.lnx.2.0-00040.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1095023   I64656aa5beaaeeaf62c5c3a5f7d10b07861b1001   IMS-VT: Don't show contact context when video is showing

Change-Id: I541859b3d1a725e9daa1a3632a7b48bb002590b8
CRs-Fixed: 1095023
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 91b67f8..99c8bde 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -258,7 +258,11 @@
 
         if (mInCallContactInteractions != null &&
                 (oldState == InCallState.INCOMING || newState == InCallState.INCOMING)) {
-            ui.showContactContext(newState != InCallState.INCOMING);
+            boolean showIncomingVideo = (primary != null) ? VideoCallPresenter.showIncomingVideo(
+                    primary.getVideoState(), primary.getState()) : false;
+            if (!showIncomingVideo) {
+                ui.showContactContext(newState != InCallState.INCOMING);
+            }
         }
 
         Log.d(this, "Primary call: " + primary);
@@ -660,6 +664,8 @@
     }
 
     private void updateContactInteractions() {
+        boolean showIncomingVideo = (mPrimary != null) ? VideoCallPresenter.showIncomingVideo(
+                mPrimary.getVideoState(), mPrimary.getState()) : false;
         if (mPrimary != null && mPrimaryContactInfo != null
                 && (mPrimaryContactInfo.locationAddress != null
                         || mPrimaryContactInfo.openingHours != null)) {
@@ -675,9 +681,13 @@
                     mDistanceHelper.calculateDistance(mPrimaryContactInfo.locationAddress),
                     mPrimaryContactInfo.openingHours);
             getUi().setContactContextContent(mInCallContactInteractions.getListAdapter());
-            getUi().showContactContext(mPrimary.getState() != State.INCOMING);
+            if (!showIncomingVideo) {
+                getUi().showContactContext(mPrimary.getState() != State.INCOMING);
+            }
         } else {
-            getUi().showContactContext(false);
+            if (!showIncomingVideo) {
+                getUi().showContactContext(false);
+            }
         }
     }