Update AOSP Dialer source from internal google3 repository at
cl/152373142.

Test: make, treehugger

This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/151342913 (3/27/2017) to cl/152373142 (4/06/2017).

This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.

Change-Id: I2fbc88cf6867b90ac8b65f75e5e34468988c7217
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index 4f5a8b7..f37ce27 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -49,6 +49,7 @@
 import com.android.dialer.common.ConfigProviderBindings;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.enrichedcall.EnrichedCallComponent;
+import com.android.dialer.lightbringer.LightbringerComponent;
 import com.android.dialer.logging.nano.ContactLookupResult;
 import com.android.incallui.latencyreport.LatencyReport;
 import com.android.incallui.util.TelecomCallUtil;
@@ -56,6 +57,7 @@
 import com.android.incallui.videotech.VideoTech.VideoTechListener;
 import com.android.incallui.videotech.empty.EmptyVideoTech;
 import com.android.incallui.videotech.ims.ImsVideoTech;
+import com.android.incallui.videotech.lightbringer.LightbringerTech;
 import com.android.incallui.videotech.utils.VideoUtils;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -1252,12 +1254,16 @@
   }
 
   private static class VideoTechManager {
+    private final Context context;
     private final EmptyVideoTech emptyVideoTech = new EmptyVideoTech();
     private final List<VideoTech> videoTechs;
     private VideoTech savedTech;
 
     VideoTechManager(DialerCall call) {
+      this.context = call.mContext;
+
       String phoneNumber = call.getNumber();
+      phoneNumber = phoneNumber != null ? phoneNumber : "";
 
       // Insert order here determines the priority of that video tech option
       this.videoTechs = new ArrayList<>();
@@ -1269,10 +1275,14 @@
               .newRcsVideoShare(
                   EnrichedCallComponent.get(call.mContext).getEnrichedCallManager(),
                   call,
-                  phoneNumber != null ? phoneNumber : "");
+                  phoneNumber);
       if (rcsVideoTech != null) {
         videoTechs.add(rcsVideoTech);
       }
+
+      videoTechs.add(
+          new LightbringerTech(
+              LightbringerComponent.get(call.mContext).getLightbringer(), call, phoneNumber));
     }
 
     VideoTech getVideoTech() {
@@ -1281,7 +1291,7 @@
       }
 
       for (VideoTech tech : videoTechs) {
-        if (tech.isAvailable()) {
+        if (tech.isAvailable(context)) {
           // Remember the first VideoTech that becomes available and always use it
           savedTech = tech;
           return savedTech;
@@ -1293,7 +1303,7 @@
 
     void dispatchCallStateChanged(int newState) {
       for (VideoTech videoTech : videoTechs) {
-        videoTech.onCallStateChanged(newState);
+        videoTech.onCallStateChanged(context, newState);
       }
     }
   }