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

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/152373142 (4/06/2017) to cl/158012278 (6/05/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: I4d3f14b5140e2e51bead9497bc118a205b3ebe76
diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java
index 4ab92a7..1653334 100644
--- a/java/com/android/incallui/InCallServiceImpl.java
+++ b/java/com/android/incallui/InCallServiceImpl.java
@@ -23,6 +23,7 @@
 import android.telecom.CallAudioState;
 import android.telecom.InCallService;
 import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler;
+import com.android.dialer.common.ConfigProviderBindings;
 import com.android.incallui.audiomode.AudioModeProvider;
 import com.android.incallui.call.CallList;
 import com.android.incallui.call.ExternalCallList;
@@ -36,6 +37,8 @@
  */
 public class InCallServiceImpl extends InCallService {
 
+  private ReturnToCallController returnToCallController;
+
   @Override
   public void onCallAudioStateChanged(CallAudioState audioState) {
     AudioModeProvider.getInstance().onAudioStateChanged(audioState);
@@ -79,6 +82,9 @@
     InCallPresenter.getInstance().onServiceBind();
     InCallPresenter.getInstance().maybeStartRevealAnimation(intent);
     TelecomAdapter.getInstance().setInCallService(this);
+    if (ConfigProviderBindings.get(this).getBoolean("enable_return_to_call_bubble", false)) {
+      returnToCallController = new ReturnToCallController(this);
+    }
 
     return super.onBind(intent);
   }
@@ -98,5 +104,9 @@
     // Tear down the InCall system
     TelecomAdapter.getInstance().clearInCallService();
     InCallPresenter.getInstance().tearDown();
+    if (returnToCallController != null) {
+      returnToCallController.tearDown();
+      returnToCallController = null;
+    }
   }
 }