Re:Wozniak praising Android over iPhone limitations
by jsight on Tuesday January 17, 2012 @06:22PM
(#3477014)
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.