title: android mediaplayer replacement for setAudioStreamType not working
body: <p>In this app, the sound must come from the earpiece speaker. This was working with <code>MediaPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL)</code>, until I updated the targetSdk to 27 and some devices with OS version > 25 started ignoring this. 
  I found out later that <code>MediaPlayer.setAudioStreamType</code> went deprecated but the new way of doing it isn't working.</p>
  
  <pre><code>AudioAttributes attr = new AudioAttributes.Builder()
                          .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
                          .setUsage(AudioAttributes.USAGE_VOICE_COMMUNICATION)
                          .build();
  
  mPlayer = MediaPlayer.create(
      getContext(),
      Uri.parse(mAudioMedia),
      null,
      attr,
      AudioManager.AUDIO_SESSION_ID_GENERATE);
  </code></pre>
  
  <p>Am I missing something?</p>