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

android video service wakelock #6515

Merged
merged 1 commit into from Nov 24, 2023

Conversation

21pages
Copy link
Collaborator

@21pages 21pages commented Nov 24, 2023

#6192
Without using battery optimization, without using lock to avoid background killing, after screen off

  • without wakelock: disconnect after 3 minutes
  • with wakelock: stay connected for 20 minutes (maybe never disconnect, test later).

The android_context used by android-wakelock needs to be initialized and it should be managed in only one place, otherwise there is a risk of crash. cpal and oboe also use it, and there is no context management in them, which is expected.
https://github.com/sagebind/android-wakelock/blob/master/src/lib.rs#L252
https://github.com/rust-mobile/ndk-context/blob/0eb252bf2306f6ca477430a35e88298e634c0b24/ndk-context/src/lib.rs#L84

move init(this) from onStartCommand to onCreate to look more reasonable, because there is no function like uninit()

Signed-off-by: 21pages <pages21@163.com>
@rustdesk rustdesk merged commit dbcf1fd into rustdesk:master Nov 24, 2023
18 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants