Skip to content

Commit

Permalink
[android] don't stop shutting down the music service if anything happ…
Browse files Browse the repository at this point in the history
…ens during broadcast to effect processors.
  • Loading branch information
gubatron committed Mar 4, 2016
1 parent 3876b97 commit eb65e38
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions android/apollo/src/com/andrew/apollo/MusicPlaybackService.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,15 @@ public void onPlaybackPositionUpdate(long newPositionMs) {
public void onDestroy() {
if (D) Log.d(TAG, "Destroying service");
super.onDestroy();
// Remove any sound effects
final Intent audioEffectsIntent = new Intent(
AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
audioEffectsIntent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
audioEffectsIntent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(audioEffectsIntent);

// Tell any sound effect processors (e.g. equalizers) that we're leaving
try {
final Intent audioEffectsIntent = new Intent(
AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
audioEffectsIntent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());
audioEffectsIntent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
sendBroadcast(audioEffectsIntent);
} catch (Throwable ignored) {}

// remove any pending alarms
if (mAlarmManager != null) {
Expand Down

0 comments on commit eb65e38

Please sign in to comment.