Android Open Source - android-music-player Audio Noisy Receiver






From Project

Back to project page android-music-player.

License

The source code is released under:

GNU General Public License

If you think the Android project android-music-player listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package pconley.vamp.player;
//from  w  w  w.ja  v  a2  s. c o m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;

/**
 * Listen for the AudioManager's AUDIO_BECOMING_NOISY intent, and pause the
 * player if it's running.
 */
public class AudioNoisyReceiver extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {

    if (intent.getAction() != null
        && intent.getAction().equals(
            AudioManager.ACTION_AUDIO_BECOMING_NOISY)) {
      context.startService(new Intent(context, PlayerService.class)
          .setAction(PlayerService.ACTION_PAUSE));
    }

  }

}




Java Source Code List

pconley.vamp.CurrentTrackActivity.java
pconley.vamp.LibraryActivity.java
pconley.vamp.TrackViewActivity.java
pconley.vamp.db.LibraryContract.java
pconley.vamp.db.LibraryHelper.java
pconley.vamp.db.TrackDAO.java
pconley.vamp.model.Tag.java
pconley.vamp.model.Track.java
pconley.vamp.player.AudioNoisyReceiver.java
pconley.vamp.player.PlayerEvents.java
pconley.vamp.player.PlayerService.java