Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power button should unlock the screen, not turn it off #97

Open
szhu opened this issue Jul 23, 2015 · 6 comments
Open

Power button should unlock the screen, not turn it off #97

szhu opened this issue Jul 23, 2015 · 6 comments
Assignees

Comments

@szhu
Copy link

szhu commented Jul 23, 2015

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.

@AChep
Copy link
Owner

AChep commented Jul 23, 2015

That makes sense. Sadly, there's no way to detect pressing power button on a non-rooted device. I check what we can do.

@szhu
Copy link
Author

szhu commented Jul 23, 2015

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?

@szhu
Copy link
Author

szhu commented Jul 23, 2015

Also, TIL Snapchat doesn't detect screenshots by detecting pressing the power key.

@szhu
Copy link
Author

szhu commented Jul 27, 2015

I see that the power key is now disabled when the lock screen is on. Is that related to this issue?

@AChep AChep self-assigned this Sep 14, 2015
@CarlosACepeda
Copy link
Collaborator

CarlosACepeda commented May 31, 2019

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

@AChep
Copy link
Owner

AChep commented May 31, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants