Using AM to turn off display with or without locking device
Posted: 03 Oct 2019 22:22
As mentioned in this thread, I'm trying to make AM turn the display on for several seconds on track change when playing music in the car. That part is easy, but there are further complications, and I figured I should make a separate thread about it since it's unrelated to the main topic of that one. The problem is that typically the phone is locked when the display is off, so when the display comes on, it only shows the lock screen, so the player info is sideways. Therefore, I need to keep it from locking when in the car. The obvious way to do this is with trusted devices, using the car BT. However, this has two problems: BT and trusted devices both have proven to be unreliable, and trusted devices doesn't provide the option to only KEEP a device unlocked but not UNLOCK it. That is, I only want it to NOT lock when connected to the device, but I DON'T want it to actually be unlocked by the device, meaning if someone stole both or stole/found the phone and were anywhere near my car (with it on, of course) they would have total access. This is, quite frankly, a gross oversight by Google.
So I'm trying to approach it from the opposite angle: disable Google's auto-locking when the power button is pressed and increase the lock delay when the screen is off and have AM do it instead, using the display off as a trigger and conditions such as BT device present as conditions to determine whether or not to actually lock it. The added bonus here is that, in theory, I might actually be able to get it to use my computer as a trusted device to keep it unlocked at home finally (what I'd really like is to be able to get my computer to lock/unlock using my phone as a BT proximity key). This approach has its own problems, however. First is that Android won't let me set the fingerprint sensor to turn the display off only--it also locks it--and I use that all the time for that. So that would bypass AM and lock the screen regardless, defeating what I'm trying to do. If I disable that option, I can't use the sensor to turn the screen off at all, and AM doesn't have the ability to do that. It does have up/down/left/right gestures, so it seems it should be able to do a long-press gesture as well.
The other problem is that when AM locks the screen, it can't be unlocked with the fingerprint sensor. This thread addresses that, and this thread provides a solution via the Control UI: lockscreen () command but, unfortunately, I'm on 8.0/Oreo, and that requires 9.0/Pie.
Thoughts/suggestions? Am I just out of luck here?
By the way, a little off-topic, but something I discovered while playing with this, because I was also thinking it would be nice to set it to turn the display on/off when I wave my hand in front of the phone, is that the proximity sensor reading in AM always shows 100cm unless I get really close, then it shows 3cm then 1cm. This is on a Moto Z Play. Is that just a limitation of the sensor, in that it only registers things 3cm or less, and then only with two discrete distances? It would make sense, since waving over it for the Moto Display only works when really close, but I guess I just assumed that's how it was configured, but that the sensors should be able to detect further out than that.
So I'm trying to approach it from the opposite angle: disable Google's auto-locking when the power button is pressed and increase the lock delay when the screen is off and have AM do it instead, using the display off as a trigger and conditions such as BT device present as conditions to determine whether or not to actually lock it. The added bonus here is that, in theory, I might actually be able to get it to use my computer as a trusted device to keep it unlocked at home finally (what I'd really like is to be able to get my computer to lock/unlock using my phone as a BT proximity key). This approach has its own problems, however. First is that Android won't let me set the fingerprint sensor to turn the display off only--it also locks it--and I use that all the time for that. So that would bypass AM and lock the screen regardless, defeating what I'm trying to do. If I disable that option, I can't use the sensor to turn the screen off at all, and AM doesn't have the ability to do that. It does have up/down/left/right gestures, so it seems it should be able to do a long-press gesture as well.
The other problem is that when AM locks the screen, it can't be unlocked with the fingerprint sensor. This thread addresses that, and this thread provides a solution via the Control UI: lockscreen () command but, unfortunately, I'm on 8.0/Oreo, and that requires 9.0/Pie.
Thoughts/suggestions? Am I just out of luck here?
By the way, a little off-topic, but something I discovered while playing with this, because I was also thinking it would be nice to set it to turn the display on/off when I wave my hand in front of the phone, is that the proximity sensor reading in AM always shows 100cm unless I get really close, then it shows 3cm then 1cm. This is on a Moto Z Play. Is that just a limitation of the sensor, in that it only registers things 3cm or less, and then only with two discrete distances? It would make sense, since waving over it for the Moto Display only works when really close, but I guess I just assumed that's how it was configured, but that the sensors should be able to detect further out than that.