Ensure listeners are added each time setUp is called
Bug: 77666799
Test: existing tests in InCallPresenterTest
PiperOrigin-RevId: 192191167
Change-Id: Ifa35451cf94d925f9d73397460b48754952cb216
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index 7ea2fad..7468b83 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -266,8 +266,6 @@
private VideoSurfaceTexture localVideoSurfaceTexture;
private VideoSurfaceTexture remoteVideoSurfaceTexture;
- private MotorolaInCallUiNotifier motorolaInCallUiNotifier;
-
private SpeakEasyCallManager speakEasyCallManager;
private boolean shouldStartInBubbleMode;
@@ -398,14 +396,12 @@
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);
- }
+ // 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 motorolaInCallUiNotifier = new MotorolaInCallUiNotifier(context);
+ addInCallUiListener(motorolaInCallUiNotifier);
+ addListener(motorolaInCallUiNotifier);
this.shouldStartInBubbleMode = shouldStartInBubbleMode(intent);