title: MediaPlayer - setAudioAttributes not working properly
body: <p>I'm trying to create an alarm, everything is working fine but the stream type is always media even tho I use <code>STREAM_ALARM</code>, since <code>setStreamType</code> is deprecated, I'm using <code>setAudioAttributes</code> instead but it doesn't seem to work.
  here's my code :</p>
  
  <pre><code>class AlarmRingtoneManager(val context: Context) {
  
      private lateinit var mediaPlayer: MediaPlayer
  
      fun start() {
          mediaPlayer = MediaPlayer.create(context,  RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM))
             .apply {
                setAudioAttributes(AudioAttributes.Builder()
                  .setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
                  .setLegacyStreamType(AudioManager.STREAM_ALARM)
                  .setUsage(AudioAttributes.USAGE_ALARM)
                  .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                  .build())
                isLooping = true
                start()
             }
      }
  
      fun stop() {
        mediaPlayer.stop()
      }
  }
  </code></pre>