When video call state is set, propagate state to InCallCall.

We ultimately need this information in the InCallUI...

Bug: 16015750
Change-Id: I5fc146e2a0812d2b9c48cf6297d9ce4193a10382
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 5f28df8..cd79b66 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -81,6 +81,7 @@
         void onStatusHintsChanged(Call call);
         void onHandleChanged(Call call);
         void onCallerDisplayNameChanged(Call call);
+        void onVideoStateChanged(Call call);
     }
 
     abstract static class ListenerBase implements Listener {
@@ -122,6 +123,8 @@
         public void onHandleChanged(Call call) {}
         @Override
         public void onCallerDisplayNameChanged(Call call) {}
+        @Override
+        public void onVideoStateChanged(Call call) {}
     }
 
     private static final OnQueryCompleteListener sCallerInfoQueryListener =
@@ -1067,6 +1070,9 @@
      */
     public void setVideoState(int videoState) {
         mVideoState = videoState;
+        for (Listener l : mListeners) {
+            l.onVideoStateChanged(this);
+        }
     }
 
     public boolean getAudioModeIsVoip() {
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index 5d07176..fee41ad 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -57,6 +57,7 @@
         void onRequestingRingback(Call call, boolean ringback);
         void onIsConferencedChanged(Call call);
         void onAudioModeIsVoipChanged(Call call);
+        void onVideoStateChanged(Call call);
     }
 
     private static final CallsManager INSTANCE = new CallsManager();
@@ -202,6 +203,13 @@
         }
     }
 
+    @Override
+    public void onVideoStateChanged(Call call) {
+        for (CallsManagerListener listener : mListeners) {
+            listener.onVideoStateChanged(call);
+        }
+    }
+
     ImmutableCollection<Call> getCalls() {
         return ImmutableList.copyOf(mCalls);
     }
diff --git a/src/com/android/telecomm/CallsManagerListenerBase.java b/src/com/android/telecomm/CallsManagerListenerBase.java
index 86c723d..7753105 100644
--- a/src/com/android/telecomm/CallsManagerListenerBase.java
+++ b/src/com/android/telecomm/CallsManagerListenerBase.java
@@ -16,7 +16,6 @@
 
 package com.android.telecomm;
 
-import android.net.Uri;
 import android.telecomm.CallAudioState;
 import android.telecomm.CallState;
 
@@ -70,4 +69,8 @@
     @Override
     public void onAudioModeIsVoipChanged(Call call) {
     }
+
+    @Override
+    public void onVideoStateChanged(Call call) {
+    }
 }
diff --git a/src/com/android/telecomm/InCallController.java b/src/com/android/telecomm/InCallController.java
index 3824c6f..7081dc9 100644
--- a/src/com/android/telecomm/InCallController.java
+++ b/src/com/android/telecomm/InCallController.java
@@ -90,6 +90,11 @@
         public void onCallerDisplayNameChanged(Call call) {
             updateCall(call);
         }
+
+        @Override
+        public void onVideoStateChanged(Call call) {
+            updateCall(call);
+        }
     };
 
     /** Maintains a binding connection to the in-call app. */
@@ -319,6 +324,6 @@
                 call.getHandlePresentation(), callerDisplayName,
                 call.getCallerDisplayNamePresentation(), call.getGatewayInfo(),
                 call.getPhoneAccount(), call.getCallVideoProvider(), parentCallId, childCallIds,
-                call.getStatusHints());
+                call.getStatusHints() , call.getVideoState());
     }
 }