you can use: AudioManager.OnAudioFocusChangeListener So you avoid asking permission READ_PHONE_STATE And you can stop the music also when the alarm clock rings you can have a look at: https://android.googlesource.com/platform/development/+/master/samples/RandomMusicPlayer/src/com/example/android/mus...