Messaging: Fix a few android related things
* NotificationBuilder.addPerson(String) -> .addPerson(Person) * Wearableextenter.addPage deprecated without replacement * Html.fromHtml(String) -> .fromHtml(String, int) * Handlers need Loopers * Resource-IDs are not final by default (if-else instead of switch-case) * call super.onFinishInflate() in override of onFinishInflate() * Configuration.locale -> configuration.getLocales().get(0) * SimpleDateFormat needs localization as well * AudioAttributes instead of setAudioStreamType() * isDataEnabled() is a public method, no need for reflection anymore Change-Id: Icd830768b86edca3e0b44f1edc6c57facc9f731a
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
package com.android.messaging.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.MediaPlayer.OnCompletionListener;
|
||||
@@ -92,7 +93,9 @@ public class NotificationPlayer implements OnCompletionListener {
|
||||
.getSystemService(Context.AUDIO_SERVICE);
|
||||
try {
|
||||
final MediaPlayer player = new MediaPlayer();
|
||||
player.setAudioStreamType(mCmd.stream);
|
||||
AudioAttributes.Builder attributes = new AudioAttributes.Builder();
|
||||
attributes.setLegacyStreamType(mCmd.stream);
|
||||
player.setAudioAttributes(attributes.build());
|
||||
player.setDataSource(Factory.get().getApplicationContext(), mCmd.uri);
|
||||
player.setLooping(mCmd.looping);
|
||||
player.setVolume(mCmd.volume, mCmd.volume);
|
||||
|
||||
Reference in New Issue
Block a user