Remove bubble "new" prefix.

Test: BubbleImplTest, BubbleImplIntegrationTest, ReturnToCallControllerTest, ReturnToCallActionReceiverTest, BottomActionViewControllerTest, ChangeOnScreenBoundsTest
PiperOrigin-RevId: 188558386
Change-Id: Ieab3ee3f148092312a50597b41c0975419756e23
diff --git a/java/com/android/incallui/AndroidManifest.xml b/java/com/android/incallui/AndroidManifest.xml
index a45330b..1b5f099 100644
--- a/java/com/android/incallui/AndroidManifest.xml
+++ b/java/com/android/incallui/AndroidManifest.xml
@@ -115,7 +115,7 @@
 
     <receiver
         android:exported="false"
-        android:name=".NewReturnToCallActionReceiver"/>
+        android:name=".ReturnToCallActionReceiver"/>
 
   </application>
 
diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java
index a7095f8..959f13f 100644
--- a/java/com/android/incallui/InCallServiceImpl.java
+++ b/java/com/android/incallui/InCallServiceImpl.java
@@ -40,7 +40,7 @@
  */
 public class InCallServiceImpl extends InCallService {
 
-  private NewReturnToCallController newReturnToCallController;
+  private ReturnToCallController returnToCallController;
   private CallList.Listener feedbackListener;
   // We only expect there to be one speakEasyCallManager to be instantiated at a time.
   // We did not use a singleton SpeakEasyCallManager to avoid holding on to state beyond the
@@ -111,9 +111,9 @@
     InCallPresenter.getInstance().onServiceBind();
     InCallPresenter.getInstance().maybeStartRevealAnimation(intent);
     TelecomAdapter.getInstance().setInCallService(this);
-    if (NewReturnToCallController.isEnabled(this)) {
-      newReturnToCallController =
-          new NewReturnToCallController(this, ContactInfoCache.getInstance(context));
+    if (ReturnToCallController.isEnabled(this)) {
+      returnToCallController =
+          new ReturnToCallController(this, ContactInfoCache.getInstance(context));
     }
     feedbackListener = FeedbackComponent.get(context).getCallFeedbackListener();
     CallList.getInstance().addListener(feedbackListener);
@@ -141,9 +141,9 @@
     // Tear down the InCall system
     InCallPresenter.getInstance().tearDown();
     TelecomAdapter.getInstance().clearInCallService();
-    if (newReturnToCallController != null) {
-      newReturnToCallController.tearDown();
-      newReturnToCallController = null;
+    if (returnToCallController != null) {
+      returnToCallController.tearDown();
+      returnToCallController = null;
     }
     if (feedbackListener != null) {
       CallList.getInstance().removeListener(feedbackListener);
diff --git a/java/com/android/incallui/NewReturnToCallActionReceiver.java b/java/com/android/incallui/ReturnToCallActionReceiver.java
similarity index 98%
rename from java/com/android/incallui/NewReturnToCallActionReceiver.java
rename to java/com/android/incallui/ReturnToCallActionReceiver.java
index 527a79b..d6014aa 100644
--- a/java/com/android/incallui/NewReturnToCallActionReceiver.java
+++ b/java/com/android/incallui/ReturnToCallActionReceiver.java
@@ -30,7 +30,7 @@
 import com.android.incallui.call.TelecomAdapter;
 
 /** Handles clicks on the return-to-call bubble */
-public class NewReturnToCallActionReceiver extends BroadcastReceiver {
+public class ReturnToCallActionReceiver extends BroadcastReceiver {
 
   public static final String ACTION_RETURN_TO_CALL = "returnToCallV2";
   public static final String ACTION_TOGGLE_SPEAKER = "toggleSpeakerV2";
diff --git a/java/com/android/incallui/NewReturnToCallController.java b/java/com/android/incallui/ReturnToCallController.java
similarity index 82%
rename from java/com/android/incallui/NewReturnToCallController.java
rename to java/com/android/incallui/ReturnToCallController.java
index e779205..6227c77 100644
--- a/java/com/android/incallui/NewReturnToCallController.java
+++ b/java/com/android/incallui/ReturnToCallController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,6 +26,10 @@
 import android.support.annotation.VisibleForTesting;
 import android.telecom.CallAudioState;
 import android.text.TextUtils;
+import com.android.bubble.Bubble;
+import com.android.bubble.BubbleComponent;
+import com.android.bubble.BubbleInfo;
+import com.android.bubble.BubbleInfo.Action;
 import com.android.contacts.common.util.ContactDisplayUtils;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.configprovider.ConfigProviderBindings;
@@ -41,10 +45,6 @@
 import com.android.incallui.call.DialerCall;
 import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo;
 import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize;
-import com.android.newbubble.NewBubble;
-import com.android.newbubble.NewBubbleComponent;
-import com.android.newbubble.NewBubbleInfo;
-import com.android.newbubble.NewBubbleInfo.Action;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
@@ -59,12 +59,12 @@
  * <p>Bubble hides when one of following happens: 1. a call disconnect and there is no more
  * outgoing/ongoing call 2. show in-call UI
  */
-public class NewReturnToCallController implements InCallUiListener, Listener, AudioModeListener {
+public class ReturnToCallController implements InCallUiListener, Listener, AudioModeListener {
 
   private final Context context;
 
   @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
-  NewBubble bubble;
+  Bubble bubble;
 
   private static Boolean canShowBubblesForTesting = null;
 
@@ -82,16 +82,16 @@
     return ConfigProviderBindings.get(context).getBoolean("enable_return_to_call_bubble_v2", false);
   }
 
-  public NewReturnToCallController(Context context, ContactInfoCache contactInfoCache) {
+  public ReturnToCallController(Context context, ContactInfoCache contactInfoCache) {
     this.context = context;
     this.contactInfoCache = contactInfoCache;
 
-    toggleSpeaker = createActionIntent(NewReturnToCallActionReceiver.ACTION_TOGGLE_SPEAKER);
+    toggleSpeaker = createActionIntent(ReturnToCallActionReceiver.ACTION_TOGGLE_SPEAKER);
     showSpeakerSelect =
-        createActionIntent(NewReturnToCallActionReceiver.ACTION_SHOW_AUDIO_ROUTE_SELECTOR);
-    toggleMute = createActionIntent(NewReturnToCallActionReceiver.ACTION_TOGGLE_MUTE);
-    endCall = createActionIntent(NewReturnToCallActionReceiver.ACTION_END_CALL);
-    fullScreen = createActionIntent(NewReturnToCallActionReceiver.ACTION_RETURN_TO_CALL);
+        createActionIntent(ReturnToCallActionReceiver.ACTION_SHOW_AUDIO_ROUTE_SELECTOR);
+    toggleMute = createActionIntent(ReturnToCallActionReceiver.ACTION_TOGGLE_MUTE);
+    endCall = createActionIntent(ReturnToCallActionReceiver.ACTION_END_CALL);
+    fullScreen = createActionIntent(ReturnToCallActionReceiver.ACTION_RETURN_TO_CALL);
 
     InCallPresenter.getInstance().addInCallUiListener(this);
     CallList.getInstance().addListener(this);
@@ -156,12 +156,12 @@
   }
 
   @VisibleForTesting
-  public NewBubble startBubble() {
+  public Bubble startBubble() {
     if (!canShowBubbles(context)) {
-      LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission");
+      LogUtil.i("ReturnToCallController.startBubble", "can't show bubble, no permission");
       return null;
     }
-    NewBubble returnToCallBubble = NewBubbleComponent.get(context).getNewBubble();
+    Bubble returnToCallBubble = BubbleComponent.get(context).getBubble();
     returnToCallBubble.setBubbleInfo(generateBubbleInfo());
     returnToCallBubble.show();
     return returnToCallBubble;
@@ -181,7 +181,7 @@
     if ((bubble == null || !bubble.isVisible())
         && getCall() != null
         && !InCallPresenter.getInstance().isShowingInCallUi()) {
-      LogUtil.i("NewReturnToCallController.onCallListChange", "going to show bubble");
+      LogUtil.i("ReturnToCallController.onCallListChange", "going to show bubble");
       show();
     }
   }
@@ -248,8 +248,8 @@
     }
   }
 
-  private NewBubbleInfo generateBubbleInfo() {
-    return NewBubbleInfo.builder()
+  private BubbleInfo generateBubbleInfo() {
+    return BubbleInfo.builder()
         .setPrimaryColor(context.getResources().getColor(R.color.dialer_theme_color, null))
         .setPrimaryIcon(Icon.createWithResource(context, R.drawable.on_going_call))
         .setStartingYPosition(
@@ -306,7 +306,7 @@
 
   @NonNull
   private PendingIntent createActionIntent(String action) {
-    Intent intent = new Intent(context, NewReturnToCallActionReceiver.class);
+    Intent intent = new Intent(context, ReturnToCallActionReceiver.class);
     intent.setAction(action);
     return PendingIntent.getBroadcast(context, 0, intent, 0);
   }
@@ -339,45 +339,42 @@
 
   private static class ReturnToCallContactInfoCacheCallback implements ContactInfoCacheCallback {
 
-    private final WeakReference<NewReturnToCallController> newReturnToCallControllerWeakReference;
+    private final WeakReference<ReturnToCallController> returnToCallControllerWeakReference;
 
-    private ReturnToCallContactInfoCacheCallback(
-        NewReturnToCallController newReturnToCallController) {
-      newReturnToCallControllerWeakReference = new WeakReference<>(newReturnToCallController);
+    private ReturnToCallContactInfoCacheCallback(ReturnToCallController returnToCallController) {
+      returnToCallControllerWeakReference = new WeakReference<>(returnToCallController);
     }
 
     @Override
     public void onContactInfoComplete(String callId, ContactCacheEntry entry) {
-      NewReturnToCallController newReturnToCallController =
-          newReturnToCallControllerWeakReference.get();
-      if (newReturnToCallController == null) {
+      ReturnToCallController returnToCallController = returnToCallControllerWeakReference.get();
+      if (returnToCallController == null) {
         return;
       }
       if (entry.photo != null) {
-        newReturnToCallController.onPhotoAvatarReceived(entry.photo);
+        returnToCallController.onPhotoAvatarReceived(entry.photo);
       } else {
         DialerCall dialerCall = CallList.getInstance().getCallById(callId);
         if (dialerCall != null) {
-          newReturnToCallController.onLetterTileAvatarReceived(
-              newReturnToCallController.createLettleTileDrawable(dialerCall, entry));
+          returnToCallController.onLetterTileAvatarReceived(
+              returnToCallController.createLettleTileDrawable(dialerCall, entry));
         }
       }
     }
 
     @Override
     public void onImageLoadComplete(String callId, ContactCacheEntry entry) {
-      NewReturnToCallController newReturnToCallController =
-          newReturnToCallControllerWeakReference.get();
-      if (newReturnToCallController == null) {
+      ReturnToCallController returnToCallController = returnToCallControllerWeakReference.get();
+      if (returnToCallController == null) {
         return;
       }
       if (entry.photo != null) {
-        newReturnToCallController.onPhotoAvatarReceived(entry.photo);
+        returnToCallController.onPhotoAvatarReceived(entry.photo);
       } else {
         DialerCall dialerCall = CallList.getInstance().getCallById(callId);
         if (dialerCall != null) {
-          newReturnToCallController.onLetterTileAvatarReceived(
-              newReturnToCallController.createLettleTileDrawable(dialerCall, entry));
+          returnToCallController.onLetterTileAvatarReceived(
+              returnToCallController.createLettleTileDrawable(dialerCall, entry));
         }
       }
     }
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java
index 87f332a..e2340b5 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -657,8 +657,8 @@
     } else if (call.hasProperty(Details.PROPERTY_HAS_CDMA_VOICE_PRIVACY)) {
       return R.drawable.quantum_ic_phone_locked_vd_theme_24;
     }
-    // If NewReturnToCall is enabled, use the static icon. The animated one will show in the bubble.
-    if (NewReturnToCallController.isEnabled(context)) {
+    // If ReturnToCall is enabled, use the static icon. The animated one will show in the bubble.
+    if (ReturnToCallController.isEnabled(context)) {
       return R.drawable.quantum_ic_call_vd_theme_24;
     } else {
       return R.drawable.on_going_call;