Volume preference - blocking volume keys
<p>I have seen couple of similar problems with solutions, but I couldn't find one that would work in my situation.</p>

<p>I am making VolumePreference (extending DialogPreference) that let's user choose volume level for some alarm. </p>

<p>In other preference user chooses desired ringtone that is played during alarm. It is also played while user is choosing volume in VolumePreference, so he knows how it actually sounds.</p>

<p>In yet another preference user chooses if alarm should "override" phone's media volume level when playing - I do that, so if user wants to have fixed volume level for alarm, then it shouldn't be affected by changes made by volume keys and so on. 
If user chooses to do that, before starting to play alarm in AlarmActivity, I set volume to max level with AudioManager and intercept all keyDown events of volume keys, restoring volume level after alarm finishes.</p>

<p>Problem is, I can't block volume keys within my VolumePreference as there is no onKeyDown method.</p>

<p>After some checking, I found registerMediaButtonEventReceiver method of AudioManager that "Register a component to be the sole receiver of MEDIA_BUTTON intents.", which I believe could help in my situation (making some empty receiver), and even make volume locking more universal (register when I want to start lock, unregister after unlock), but it is working from API8, while I am making app for API7 - which still hold over 10% of market from what I read, so I would like to stick to it.</p>

<p>Any ideas on how one could block volume changes in PreferenceDialog?</p>
