Skip to content

fix(android): prevent screen from turning off during active video calls in example application#1057

Open
mechtech-mind wants to merge 2 commits intolivekit:mainfrom
mechtech-mind:main
Open

fix(android): prevent screen from turning off during active video calls in example application#1057
mechtech-mind wants to merge 2 commits intolivekit:mainfrom
mechtech-mind:main

Conversation

@mechtech-mind
Copy link
Copy Markdown
Contributor

This PR fixes an issue in the Android example application where the device screen turns off automatically during an active video call due to screen timeout.

Problem

During an ongoing LiveKit call on Android, the screen is not kept awake, which leads to:

  • Poor user experience during video calls
  • Interrupted visibility when no user interaction occurs

Solution

This PR adds native Android window flag handling in MainActivity to ensure the screen remains active while a call is in progress:

  • Uses native flags to prevent screen timeout
  • Uses native flags as well to handle lock screen visibility

The flags are:

  • Enabled when the room is active
  • Cleared when the room is disposed

Copy link
Copy Markdown
Contributor Author

@mechtech-mind mechtech-mind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hiroshihorie is it ok?

Copy link
Copy Markdown
Contributor Author

@mechtech-mind mechtech-mind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah looks ok

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.

1 participant