Keeping device unlocked at home
Posted: 09 Nov 2016 10:47
This post is a mixture of questions about reliability of certain Automagic triggers, and a practical question seeking advice about particular use case.
General idea: When I'm at home, I want my phone to stay reliably unlocked (after I unlock it once). When I get out from home, I want my phone to reliably auto-lock.
I'm using SmartUnlock flows with some modifications - really great and I'm generally happy about how it works. But so far I'm failing to achieve a good balance between convenience and security. Some improvements are definitely needed in my case.
Trust only home Wi-Fi: secure, but phone always re-locks when it's unplugged and not being used for some time. My Wi-Fi advanced option "Keep Wi-Fi on during sleep" is set to "Only when plugged in", if I set it to "Always", phone never goes to deep sleep, draining battery a lot. Something on my Wi-Fi network is preventing it sleeping (using static IP, like often recommended, didn't help) - that is a separate topic. So, apparently the Wi-Fi disconnected trigger gets executed, SmartUnlock locks the phone 1 minute later unless reconnected.
So, Wi-Fi alone doesn't keep phone unlocked when it is unplugged.
Trust home Wi-Fi and location: convenient, but insecure. Using a "Location" trigger ("Modern (experimental)" method) with 500 m radius (SmartUnlock's default), phone stays mostly unlocked while at home. In rare cases it still locks, that means further decreasing radius would reduce convenience. However, many times I take a walk around the neighborhood, sometimes going as far away as 1 km, and when I check my phone, it is still unlocked.
One time I've tried debugging it while away from home - created a new flow which executes "Init Variable Location: last known location" action then opens google maps with this location in the browser. I measured the actual distance between this location and my trusted location and it was 600 m, more than the geofence radius. But for some reason the "Location" exiting trigger didn't execute. Can Doze be responsible for that? But I guess it should still fire when I'm waking my phone.
I don't have any BT devices I use regularly, so I don't see other options to use. Phone doesn't have NFC. Any suggestions?
Ideas:
1) When Wi-Fi is temporary disconnected because phone is sleeping and "Keep Wi-Fi on" option is off, the Wi-Fi disconnected trigger gets executed. Is there a way to distinguish such an event from manual Wi-Fi off, or going out of range of the Wi-Fi AP?
Maybe on Wi-Fi disconnected trigger, instead of removing the trusted Wi-Fi state immediately, I should start a loop that scans if that Wi-Fi AP is still in range (e.g. once a minute). If the Wi-Fi AP is out of range, remove the trusted Wi-Fi state. If the Wi-Fi gets reconnected, just exit the loop (keep trusted state). That would probably keeps the phone from re-locking, but I'm afraid it will prevent the phone from sleeping => nothing better than setting "Keep Wi-Fi during sleep".
2) When screen is off, keep using both Wi-Fi and location trusted states, but when the screen is turned on, do a Wi-Fi scan and if there is no trusted Wi-Fi around, disregard trusted location and lock the device immediately. So basically location would only be trusted while phone is in standby. Would that be secure enough, though?
General idea: When I'm at home, I want my phone to stay reliably unlocked (after I unlock it once). When I get out from home, I want my phone to reliably auto-lock.
I'm using SmartUnlock flows with some modifications - really great and I'm generally happy about how it works. But so far I'm failing to achieve a good balance between convenience and security. Some improvements are definitely needed in my case.
Trust only home Wi-Fi: secure, but phone always re-locks when it's unplugged and not being used for some time. My Wi-Fi advanced option "Keep Wi-Fi on during sleep" is set to "Only when plugged in", if I set it to "Always", phone never goes to deep sleep, draining battery a lot. Something on my Wi-Fi network is preventing it sleeping (using static IP, like often recommended, didn't help) - that is a separate topic. So, apparently the Wi-Fi disconnected trigger gets executed, SmartUnlock locks the phone 1 minute later unless reconnected.
So, Wi-Fi alone doesn't keep phone unlocked when it is unplugged.
Trust home Wi-Fi and location: convenient, but insecure. Using a "Location" trigger ("Modern (experimental)" method) with 500 m radius (SmartUnlock's default), phone stays mostly unlocked while at home. In rare cases it still locks, that means further decreasing radius would reduce convenience. However, many times I take a walk around the neighborhood, sometimes going as far away as 1 km, and when I check my phone, it is still unlocked.
One time I've tried debugging it while away from home - created a new flow which executes "Init Variable Location: last known location" action then opens google maps with this location in the browser. I measured the actual distance between this location and my trusted location and it was 600 m, more than the geofence radius. But for some reason the "Location" exiting trigger didn't execute. Can Doze be responsible for that? But I guess it should still fire when I'm waking my phone.
I don't have any BT devices I use regularly, so I don't see other options to use. Phone doesn't have NFC. Any suggestions?
Ideas:
1) When Wi-Fi is temporary disconnected because phone is sleeping and "Keep Wi-Fi on" option is off, the Wi-Fi disconnected trigger gets executed. Is there a way to distinguish such an event from manual Wi-Fi off, or going out of range of the Wi-Fi AP?
Maybe on Wi-Fi disconnected trigger, instead of removing the trusted Wi-Fi state immediately, I should start a loop that scans if that Wi-Fi AP is still in range (e.g. once a minute). If the Wi-Fi AP is out of range, remove the trusted Wi-Fi state. If the Wi-Fi gets reconnected, just exit the loop (keep trusted state). That would probably keeps the phone from re-locking, but I'm afraid it will prevent the phone from sleeping => nothing better than setting "Keep Wi-Fi during sleep".
2) When screen is off, keep using both Wi-Fi and location trusted states, but when the screen is turned on, do a Wi-Fi scan and if there is no trusted Wi-Fi around, disregard trusted location and lock the device immediately. So basically location would only be trusted while phone is in standby. Would that be secure enough, though?