AlarmSoundService: don't set volume to 100% if music is playing.
Have mercy with my ears.
This commit is contained in:
parent
db5ee7067a
commit
3be65319d7
|
@ -1,8 +1,10 @@
|
|||
package info.nightscout.androidaps.Services;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.IBinder;
|
||||
|
||||
|
@ -53,7 +55,10 @@ public class AlarmSoundService extends Service {
|
|||
log.error("Unhandled exception", e);
|
||||
}
|
||||
player.setLooping(true); // Set looping
|
||||
AudioManager manager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
|
||||
if (manager == null || !manager.isMusicActive()) {
|
||||
player.setVolume(100, 100);
|
||||
}
|
||||
|
||||
try {
|
||||
player.prepare();
|
||||
|
|
Loading…
Reference in a new issue