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

Add posibilty to keep screen off after disconection #1764

Closed
1 task done
AndDontBlink opened this issue Sep 15, 2020 · 7 comments
Closed
1 task done

Add posibilty to keep screen off after disconection #1764

AndDontBlink opened this issue Sep 15, 2020 · 7 comments

Comments

@AndDontBlink
Copy link

On version 1.15 was added that after disconection with option -S (--turn-screen-off) the screen will turn on again , but as for many this was annoying for me was a very usefull feature , so ¿can an extra option be added so that it turn screen off and dont turn on after disconection?

on code seems quite posible as for now its hardcoded to always turn it on again (true)

CleanUp.configure(mustDisableShowTouchesOnCleanUp, restoreStayOn, true);

@rom1v
Copy link
Collaborator

rom1v commented Sep 15, 2020

If I correctly understand your request, it is fixed by #1670 on dev branch.

You could try with scrcpy-server posted here (for another issue, but it includes this fix): #1468 (comment)

Please confirm that it fixes your problem.

@AndDontBlink
Copy link
Author

I look that fix and its doesnt work for what i need , the fix keeps the screen (physical) off if the screen (virtual/streamed/dont know how to call it) is already off before disconection .
I like to have exactly the behavior before 1.15 with --turn-screen-off option that keeps the "physical" screen off after disconection while the device keeps on/unlocked/awake/doing things

something like this (more complex as client also has to be modified to pass flags)

boolean restoreNormalPowerMode = !options.isForceScreenOff(); 
CleanUp.configure(mustDisableShowTouchesOnCleanUp, restoreStayOn, restoreNormalPowerMode);

@rom1v
Copy link
Collaborator

rom1v commented Sep 16, 2020

I like to have exactly the behavior before 1.15 with --turn-screen-off option that keeps the "physical" screen off after disconection while the device keeps on/unlocked/awake/doing things

Oh, this was a side-effect considered as a bug. Out of curiosity, why do you need this?

Relevant xkcd:

xkcd
(https://xkcd.com/1172/)

@AndDontBlink
Copy link
Author

I cannot argue with xkcd statements its so true jajaja

I have and old tablet that use for playing games (has autofarm) and i control it remotly from PC from time to time, so turn screen off (permanently) is very usefull for batery saving and screen use .

@AndDontBlink
Copy link
Author

Hi, its been a long time but as stated above this issue will not be implemented again .
Its there a command that i can run trougth adb that will turn off screen the same way scrpcy do whith that option ?

@rom1v
Copy link
Collaborator

rom1v commented Jul 20, 2021

Its there a command that i can run trougth adb that will turn off screen the same way scrpcy do whith that option ?

Unfortunately, no. You need to call some Android private API (in Java) like scrcpy does.

rom1v added a commit that referenced this issue Feb 13, 2022
It might be useful not to cleanup on exit (to leave the screen turned
off for example).

Fixes #1764 <#1764>
@rom1v
Copy link
Collaborator

rom1v commented Feb 13, 2022

I finally implemented an option not to cleanup: #3020.

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

No branches or pull requests

2 participants