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

Commit 783d205d authored by uabdullah's avatar uabdullah Committed by android-build-merger
Browse files

Merge changes I3f6a5887,Icf91804d am: 360c751f

am: 1a9d70ab

Change-Id: Iae7450d97e14dde7206bf1fd5eba7b2f132b95f5
parents dcb7e4fb 1a9d70ab
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.dialer.voicemail.listui;

import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
@@ -63,6 +64,7 @@ public class NewVoicemailMediaPlayer {
          () -> {
            try {
              mediaPlayer.setDataSource(context, uri);
              setAudioManagerToNonSpeakerMode(context);
            } catch (IOException e) {
              LogUtil.i(
                  "NewVoicemailMediaPlayer",
@@ -86,6 +88,13 @@ public class NewVoicemailMediaPlayer {
    }
  }

  /** We should never start playing voicemails from the speaker mode */
  private void setAudioManagerToNonSpeakerMode(Context context) {
    AudioManager audioManager = context.getSystemService(AudioManager.class);
    audioManager.setMode(AudioManager.STREAM_MUSIC);
    audioManager.setSpeakerphoneOn(false);
  }

  private void verifyListenersNotNull() {
    Assert.isNotNull(
        newVoicemailMediaPlayerOnErrorListener,
+1 −2
Original line number Diff line number Diff line
@@ -16,8 +16,7 @@
  -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/dialer_theme_color">
    android:layout_height="match_parent">

  <include layout="@layout/rtt_banner"/>