Alright, I'm at my wits end with this and it is fairly important to have this working for the release of Chromecast support. I need to be able to detect and block the standard volume key presses while outside of the app and when using a remote media player (either ChromeCast or Jukebox). I have found a couple of hacky ways to detect when the volume is changed outside of the app, but I can't figure out how to stop the default volume action from happening. It's pointless to be able to change the volume if you are also doing something unintended such as changing the ringer volume. Things I have tried so far:
Listening in the registerMediaButtonEventReceiver event. Volume keys don't seem to go through here at all.
ContentOberserver
Defining a custom broadcast receiver that listens for android.media.VOLUME_CHANGED_ACTION. Broadcast is not ordered though so it can't be cancelled.
I need this to work and I can't figure it out. I know it is possible because Play Music does it while casting just fine. I don't even need you to plug in all of the actual logic behind it, I just need a concrete way to both get which volume key was pressed, and to block the default system volume change while not in the activity. I am offering a $50 bounty for a fix to this issue, paid via Paypal.