Application: a UPNP media server runing on Google TV. I’d like to raise and lower the volume of the TV and/or amplifier (as configured by the user in system settings).
AudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, …) does pretty much nothing when the user has configured the Google TV device to use volume control on the TV or Amplifier.
Is there a way to simulate the effect of the Volume Up, Down and Mute keys on a Google TV remote, from software?
I know it can be done with the Anymote protocol. But that requires pairing, even when the UPNP media server is running locally. Not happening.
The functionality runs in a service that potentially has no active UI, so dispatching a KeyEvent isn’t an option either, I don’t think.
The new Google TVs (NSZ, Vizio and LG) are ARM based. As to the question about volume control – because the volume control has been handed over to an external system you would need to listen in on changes to the other device as well the application would need to know what the active audio stream was. From the limited code snippet above it looks like you are trying to set the volume on STREAM_MUSIC have you tried STREAM_SYSTEM?
Another thought I had was that you could run a version of an Anymote client in your application as a service (the remote would run on the tv – kinda strange but could work) and your app could then call the service to trigger the volume change since you indicated it works with Anymote.