AcDisplay
AcDisplay copied to clipboard
Power button should unlock the screen, not turn it off
I think there should at least be an option that pressing the power button when AcDisplay active should cause AcDisplay to unlock, instead of turning the screen off. In other words, AcDisplay should be equivalent to the "screen off" state.
I think this feature would be not only nice to have just because, but also because I think it's really important from an interaction perspective. The rest of this issue explains why—
The advantage of AcDisplay is that it can provide me additional information, if I want it, without breaking my current workflow. However, the way I have AcDisplay current set up, it breaks my workflow.
First, my setup is as follows: System: passcode lockscreen, locks after 10-minute delay unless kept unlocked by smart lock AcDisplay: yes wake on notification, yes active mode, no use as lockscreen
Here are some scenarios where AcDisplay causes more interaction than if I did not use AcDisplay. These are not just theoretical – I encounter each of these a few times a day.
- A lot of the time I have absolutely no lockscreen, such that when I press the power button, my phone will appear exactly where I left off. With AcDisplay, if I just received a notification, or if I just took the phone pocket, I now need to do a finger swipe.
- AcDisplay turns itself on in the above situation. Sometimes, I forget that it turns itself on (also, sometimes it doesn't do a good job of turning itself on via proximiy sensor). In these cases, pressing the power button has the opposite effect of what I intended it to do.
- When I have a lockscreen on, AcDisplay adds on another layer of lockscreen, which seems redundant.
None of these scenarios would exist if pressing the power button turned the phone on instead of off.
With that said, I think that AcDisplay (even despite this) is incredible app. If someone can give me pointers on where in the code base I can start looking to address this issue, that would be appreciated too.
That makes sense. Sadly, there's no way to detect pressing power button on a non-rooted device. I check what we can do.
I'm on a rooted device. Also, AcDisplay already has Xposed hooks, so using root isn't really setting a precedent.
Also, I'm not sure what technical capabilities Xposed provides. Would this functionality be something that should go into the Xposed module or be separate?
Also, TIL Snapchat doesn't detect screenshots by detecting pressing the power key.
I see that the power key is now disabled when the lock screen is on. Is that related to this issue?
Registering a broadcast receiver Screen On/Off can help with this issue? And applying a condition to that broadcast receiver, verifying the current settings of AcDisplay,
If AcDisplay is not setted as Lockscreen, and the Active Mode is on and Turn Screen automatically on new notification then, use a wakelock, turn on again the device and close the Activity that handles the lockscreen, that'll be a workaround. @AChep
Registering a broadcast receiver Screen On/Off can help with this issue? And applying a condition to that broadcast receiver, verifying the current settings of AcDisplay,
If AcDisplay is not setted as Lockscreen, and the Active Mode is on and Turn Screen automatically on new notification then, use a wakelock, turn on again the device and close the Activity that handles the lockscreen, that'll be a workaround. @AChep
No, you can not use the SCREEN_ON/OFF event cause it has no distinction between "user turned the screen off" and "the screen turned off by itself". Also, I don't like the idea of such workarounds where screen gets turned off and then pops on again.