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

Commit ffe31a01 authored by uabdullah's avatar uabdullah Committed by Eric Erfanian
Browse files

Reset speaker mode when done with VVM Tab

Bug: 110530781,78281972
Test: N/A
PiperOrigin-RevId: 201729044
Change-Id: Id00e8e3e4ee89b846bce78f4a29d5e6f26384e0c
parent 336cc00d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -127,6 +127,12 @@ public class VisualVoicemailCallLogFragment extends CallLogFragment {
  public void onPause() {
    voicemailPlaybackPresenter.onPause();
    voicemailErrorManager.onPause();
    // Necessary to reset the speaker when leaving otherwise the platform will still remain in
    // speaker mode
    AudioManager audioManager = getContext().getSystemService(AudioManager.class);
    if (audioManager.isSpeakerphoneOn()) {
      audioManager.setSpeakerphoneOn(false);
    }
    super.onPause();
  }

+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.AsyncTask;
@@ -207,6 +208,8 @@ public class VoicemailPlaybackPresenter
      position = savedInstanceState.getInt(CLIP_POSITION_KEY, 0);
      isPlaying = savedInstanceState.getBoolean(IS_PLAYING_STATE_KEY, false);
      isSpeakerphoneOn = savedInstanceState.getBoolean(IS_SPEAKERPHONE_ON_KEY, false);
      AudioManager audioManager = activity.getSystemService(AudioManager.class);
      audioManager.setSpeakerphoneOn(isSpeakerphoneOn);
    }

    if (mediaPlayer == null) {