-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Send wakeup keycode alongside trying to turn screen on when restoring #1670
Send wakeup keycode alongside trying to turn screen on when restoring #1670
Conversation
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); | ||
Device device = new Device(new Options()); | ||
if(device.isScreenOn()){ | ||
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rom1v Is it better this way? It works too with my phone.
PR #1670 <#1670> Signed-off-by: Romain Vimont <[email protected]>
My first thought was it was incorrect to reset the power mode to normal only when the screen is on: I still want to be able to physically turn the screen on with a double tab on the screen (without pressing POWER)¹. If the screen is not reset to normal, I thought it would not work. In fact, it's the opposite:
Therefore, I agree with this change. I made Could you please review/test? (branch ¹ Btw, turning the screen on with a double tap (only supported on some devices) is not catched by #1577. |
Doesn't work on my phone. I need this API to turn it back on, otherwise, the double-tab turns off and locks and then double-tab turns it back on.
LGTM.
True, that's by design. #1577, by design, is intended to act only for actions done in scrcpy. Do you think the documentation requires more clarification? |
👍 Merged into
Sorry, I don't get it. With the following steps:
Without this change, it stays black. With this change, it works. (Initially, I thought it would be the contrary)
👍 Btw, double-tap with a double-click in scrcpy works to turn the screen off, but not to turn it back on. |
Without this change: Seems like in phones like yours, only the screen turns on but not the display (no image but light on). However, the OS changes mode to "awaken" (or whatever name). So when you double-tap it, it turns off both screen and display. With this change: Makes sense? |
scrcpy v1.17 Changes since v1.16: - Fix errors on Android 11 (Genymobile#1468) - Add --encoder option (Genymobile#1810, Genymobile#1827) - Add --forward-all-clicks option (Genymobile#1302, Genymobile#1613) - Add --legacy-paste option (Genymobile#1750, Genymobile#1771) - Workaround screen off/on issue on exit (Genymobile#1670) - Rework console/noconsole versions on Windows (Genymobile#1875, Genymobile#1988) - Terminate server properly without killing it on close (Genymobile#1992) - List available shortcut keys on error (Genymobile#1681) - Upgrade platform-tools to 30.0.5 (adb) in Windows releases - Upgrade SDL to 2.0.14 in Windows releases
No description provided.