Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 724cc8f0 authored by yueg's avatar yueg Committed by Copybara-Service
Browse files

Show bubble when call connected and in-call UI not showing.

We used to only show bubble when leaving in-call UI, so answering from Bluetooth does not show bubble. Fix it by also showing bubble in onCallListChanged().

Test: NewReturnToCallControllerTest
PiperOrigin-RevId: 188403460
Change-Id: I5e6a3c37b2773e426dcc73ae5661b9e145b20cb8
parent 98ff44d0
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -51,7 +51,13 @@ import java.util.List;

/**
 * Listens for events relevant to the return-to-call bubble and updates the bubble's state as
 * necessary
 * necessary.
 *
 * <p>Bubble shows when one of following happens: 1. a new outgoing/ongoing call appears 2. leave
 * in-call UI with an outgoing/ongoing call
 *
 * <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 {

@@ -171,7 +177,14 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au
  public void onSessionModificationStateChange(DialerCall call) {}

  @Override
  public void onCallListChange(CallList callList) {}
  public void onCallListChange(CallList callList) {
    if ((bubble == null || !bubble.isVisible())
        && getCall() != null
        && !InCallPresenter.getInstance().isShowingInCallUi()) {
      LogUtil.i("NewReturnToCallController.onCallListChange", "going to show bubble");
      show();
    }
  }

  @Override
  public void onDisconnect(DialerCall call) {