Widget to toggle "OK Google" detection always on/off I am looking for a widget which toggles my Nexus 6's option for "OK Google" always listen on/off.

Usually when I am in the car, I need the phone to always listen for "OK Google" and easily turn it on before I get there. After I leave the car, I need to turn it off, because it detects random sounds as the command and never stops listening for noise sounds.

I think such widget does not exists and I do not know if Android exposes API calls for this. I am web developer and I am willing to try to code this widget myself (never tried to code for Android), but I have the will if someone points me to the right direction.

Thanks!
It's not the best method but if you happen to use Nova Launcher you can make a widget that gets to the Voice Command Preferences (which is just one click away from accessing the detection settings).


Long-press on the home screen (with Nova installed)
Click Widgets
Place an Activities shortcut somewhere on your homescreen.
Scroll down to the Google App
Choose com.google.android.voicesearch.VoiceSearchPreferences 


and you'll at least have a widget that gets you right to the Voice Search Preferences where you can then click on Ok Google detection.