|
|
@ -91,6 +91,8 @@ public class MediaPlayerHelper {
|
|
|
|
sem = new Semaphore(0);
|
|
|
|
sem = new Semaphore(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Playing sound=" + uri);
|
|
|
|
|
|
|
|
|
|
|
|
AudioAttributes attrs = new AudioAttributes.Builder()
|
|
|
|
AudioAttributes attrs = new AudioAttributes.Builder()
|
|
|
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
|
|
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
|
|
|
.setUsage(alarm ? AudioAttributes.USAGE_ALARM : AudioAttributes.USAGE_NOTIFICATION)
|
|
|
|
.setUsage(alarm ? AudioAttributes.USAGE_ALARM : AudioAttributes.USAGE_NOTIFICATION)
|
|
|
@ -157,6 +159,8 @@ public class MediaPlayerHelper {
|
|
|
|
nm.cancel("alarm", 1);
|
|
|
|
nm.cancel("alarm", 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Played sound=" + uri);
|
|
|
|
|
|
|
|
|
|
|
|
synchronized (lock) {
|
|
|
|
synchronized (lock) {
|
|
|
|
sem = null;
|
|
|
|
sem = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|