On my Google Pixel (and presumably other modern Android devices), there is a setting called Trusted Voice:

Trusted Voice. Let "Ok Google" unlock your device when the sound matches your voice model.

I'd like to enable this feature, since without it I can't use Google Assistant hands-free when my phone is locked. (Even simple search queries which don't involve accessing any of my personal information require my phone to be unlocked first.) Unfortunately, this obviously comes with some significant security risks:

"Ok Google" Trusted Voice. This can be less secure: a similar voice or recording of yours could unlock your device.

I'd like to mitigate the impact of this by only allowing the Trusted Voice feature to be used in specific situations, like when I'm sitting at home. Is there a way to do this? (Maybe I could toggle this feature on and off with Tasker? I didn't see any immediately obvious way to do that in Tasker's list of actions.)


Alrighty so there's no way to my knowledge to toggle trusted voice as it requires authentication with each toggle. I'm thinking when on the lockscreen or screen off and not near your home just kill the mic, trusted voice relies on this and therefore would not function.

To detect your house I would use Wi-Fi Near or Connected YOURSSID. Obviously not near your house would be when either of those equaled false.

Detecting screen off is easy but you don't want mic to immediately turn back on when screen comes on but your on the lockscreen. Then once the lockscreen unlocks your going to want your mic back on.

After all that psuedocode here's a profile I've created based on the above logic.

1st Profile | Away from house pt. 1

Event: Screen Off & Not near your Wi-Fi

Task: Mute mic

2nd Profile | Away from house pt. 2

Event: Screen On & Not near your Wi-Fi

Task: Wait until keyguard is unlocked and when it is unmute mic

3rd Profile | At house

Event: Near your Wi-Fi

Task: Unmute mic

Profiles zip: https://drive.google.com/file/d/0B48arFbBn-PdR2JlX3Ryblk2Wms/view?usp=drivesdk

Place all three .xml files in /sdcard/Tasker/profiles. Then to import long press the profiles tab in the Tasker app and hit import, select the three. Change the YOURWIFI to the name of your Wi-Fi in each of the profiles.

I have tested the mic muting and unmuting but I cannot test the rest, let me know how it goes.

  • Cool idea, but it doesn't seem to work for me. My Pixel responds to "Ok Google" regardless of whether or not the mic is muted. Other applications are unable to record audio, but Google Assistant still works fine.
    – Ajedi32
    Jan 21 '17 at 18:57
  • @Ajedi32 I'll look into possibly killing the Google app while screen off instead of muting mic.
    – Ben Baltz
    Jan 21 '17 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.