I am one of those people who do not like keeping location services on all the time.
Which puts me in a situation where I cannot keep my phone unlocked at home via Smart Lock by location.
I read quite a few posts on the subject on why smart lock is not applicable and will not be applicable officially to WiFi networks - mainly 'cuz of spoofing.
So I am trying to find a simple non-intrusive workaround for this to use on my phone at home.
I was thinking about a combination of the following two options here: Screen Lock Settings
Automatically lock after sleep - set to i.e. 5seconds Power button instantly locks - turned off
So my idea is to achieve that with a simple background running app that would listen for sleep triggered by the power button. After such sleep event is triggered the app will re-trigger sleep in 4s only if connected to my home WiFi network ( in other words reset that 5s automatically lock after sleep timer). This would keep my phone in a sleep but not-locked state.
Once I leave home/turn off my WiFi or wake up my phone the app will return in the listening state.
What I am not sure is.. is it possible to trigger sleep event manually?