You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Turn the screen on if the connection with scrcpy is dropped abruptly #1572
Is your feature request related to a problem? Please describe.
Sometimes I disconnect my phone from the PC and the screen is left off.
I may forget that the phone is actually not locked and not even asleep and I leave the phone like that possibly for too long.
Also, my wifi is not very stable and I'm enough of a security freak but I also love the convenience so I care to press the "OK" every time I connect to the phone in debug mode.
By adding this behavior, I can control my phone immediately when a disconnect happens without having to press power twice (or 3 times, if the phone is already asleep):
In sum, reduce these steps:
Wake up (but screen doesn't) (Only if asleep)
Sleep + lock
Wake up; screen wake up
Fill in the pattern
(confirm fingerprint) Press OK
To:
(confirm fingerprint) Press OK
Extra:
I intent to implement this myself. It can also allow me to familiarize with these workings of android.
This issue is to confirm if I have green light for such feature in scrcpy
Sometimes I disconnect my phone from the PC and the screen is left off.
I may forget that the phone is actually not locked and not even asleep and I leave the phone like that possibly for too long.
This issue is to confirm if I have green light for such feature in scrcpy
Yes, I already encounter this problem 😉 Thank you for tackling this.
Since we can't know if the current power mode is NORMAL or OFF, I suggest to always set it to NORMAL on close.
Therefore, the clean up process must always be started (currently, CleanUp.configure() starts it only if there were things to clean up), and the main method must call Device.setScreenPowerMode().
Activity
rom1v commentedon Jul 7, 2020
Hi,
Yes, I already encounter this problem 😉 Thank you for tackling this.
The code to modify is in
CleanUp.java(see 2f74ec2).Since we can't know if the current power mode is NORMAL or OFF, I suggest to always set it to NORMAL on close.
Therefore, the clean up process must always be started (currently,
CleanUp.configure()starts it only if there were things to clean up), and themainmethod must callDevice.setScreenPowerMode().(Don't forget to start from the
devbranch.)Restore power mode to normal on cleanup
rom1v commentedon Jul 9, 2020
#1576 30714ab