Roll forward the broadcast in-call UI changes.

Test: InCallPresenterTest
PiperOrigin-RevId: 181512032
Change-Id: Id120d9fe6f46ad157eab7f97614d0c18b6aef8e1
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index ae25f4d..f0d3adc 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -260,6 +260,8 @@
   private VideoSurfaceTexture localVideoSurfaceTexture;
   private VideoSurfaceTexture remoteVideoSurfaceTexture;
 
+  private MotorolaInCallUiNotifier motorolaInCallUiNotifier;
+
   /** Inaccessible constructor. Must use getRunningInstance() to get this singleton. */
   @VisibleForTesting
   InCallPresenter() {}
@@ -382,6 +384,15 @@
 
     AudioModeProvider.getInstance().addListener(this);
 
+    if (motorolaInCallUiNotifier == null) {
+      // Add listener to notify Telephony process when the incoming call screen is started or
+      // finished. This is for hiding USSD dialog because the incoming call screen should have
+      // higher precedence over this dialog.
+      motorolaInCallUiNotifier = new MotorolaInCallUiNotifier(context);
+      addInCallUiListener(motorolaInCallUiNotifier);
+      addListener(motorolaInCallUiNotifier);
+    }
+
     LogUtil.d("InCallPresenter.setUp", "Finished InCallPresenter.setUp");
     Trace.endSection();
   }