Yes, I've tried a few for her, and they all don't work as advertised. She always wants the ringer on max, so I figured that I would see if there was a simple way to disable the buttons. Did it on my phone in about 5 minutes as a test (mine is rooted) so I went about to try it on hers. No root, no dice (can't remount /system as rw to edit the file).
So then I thought, how about an app for that. Listen for keypresses, set the volume to max, easy peasy. Ha. Services can't listen for keypresses. Apps only listen when they are in focus. All apps are run as their own user and group and the /dev/input devices are not readable by anybody but root or those in the input group. 3 ideas on a simple app, no way to do it without rooting the phone.
Services cannot listen for keypresses, but can't they change the volume? Why not have the service periodically check the volume and reset it to max automatically?
Ie, something like:
// Get the AudioManager
AudioManager audioManager =
(AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
// Set the volume of played media to maximum.
audioManager.setStreamVolume (
AudioManager.STREAM_MUSIC,
audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
0);
Unless there are more requirements here that I am missing, this sounds achievable without root.
So then I thought, how about an app for that. Listen for keypresses, set the volume to max, easy peasy. Ha. Services can't listen for keypresses. Apps only listen when they are in focus. All apps are run as their own user and group and the /dev/input devices are not readable by anybody but root or those in the input group. 3 ideas on a simple app, no way to do it without rooting the phone.