Set ringtone stream using audio attributes. am: 95a9ae79d7 am: 0da27c2d8d
am: 7eabc798dd
Change-Id: Icdb7f5561a68acf88df74b8ec1e7e79581c2d5a0
diff --git a/src/com/android/server/telecom/RingtoneFactory.java b/src/com/android/server/telecom/RingtoneFactory.java
index 7229ac6..4ea5008 100644
--- a/src/com/android/server/telecom/RingtoneFactory.java
+++ b/src/com/android/server/telecom/RingtoneFactory.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
+import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.media.Ringtone;
@@ -96,7 +97,10 @@
contextToUse, defaultRingtoneUri, volumeShaperConfig);
}
if (ringtone != null) {
- ringtone.setStreamType(AudioManager.STREAM_RING);
+ ringtone.setAudioAttributes(new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .build());
}
return ringtone;
}