Toggling Android's `command_ringer_mode`

I just learnt about command_ringer_mode.

Has anyone came up with an interface to sense and command it to cycle through the normal, vibrate and silent?

Thank you.