TheLastCrusade/SoundStream — pull request #160 by theJenix (2013-06-09 19:34:50+00:00)
Title: Fixes for various bugs with audio ducking/focus, and some misc NPEs

Fixed problem where audio was being unpaused when a user pauses the song..., and an audio event from another app happens. In the process, I found a really weird
bug with Android Audio focus...if two or more other apps request audiofocus gain
can duck at or around the same time, audio focus may not always be returned to
SoundStream. This is fixed by using a timer task, scheduled 2 seconds out from
when we got the can_duck notification, and will re-grab audio focus and unduck
the volume manually

modified external control client to not create the client immediately (but not
register it). This is useful because it means the client object is never null,
which fixes a crash caused by pressing play very quickly after adding your first
song.

added test for null in SingleFileAudioPlayer to fix the same kind of bug.