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

fix: Keep screen active when user is recording audio (WPB-3479) #2056

Merged

Conversation

alexandreferris
Copy link
Contributor


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When user was recording an audio, the screen would not be kept on and would lock the phone, thus stopping the recording.

Causes (Optional)

Not implemented.

Solutions

Add a disposable effect to add flag FLAG_KEEP_SCREEN_ON when user is recording an audio, and dispose of the flag when it is ready to send or discarded.

Testing

How to Test

  • Open App
  • Open Conversation
  • Open Record Audio Component
  • If audio recording State is RECORDING (red button to stop recording is shown) then the device won't lock the screen by itself.

@alexandreferris alexandreferris changed the base branch from develop to release/candidate August 3, 2023 14:50
@alexandreferris alexandreferris requested review from a team, typfel, MohamadJaara, vitorhugods, Garzas and trOnk12 and removed request for a team August 3, 2023 15:11
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

Test Results

512 tests   511 ✔️  27s ⏱️
  74 suites      1 💤
  74 files        0

Results for commit b4fe343.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 893 succeeded.

The build produced the following APK's:

@alexandreferris alexandreferris enabled auto-merge (squash) August 3, 2023 15:40
@@ -100,6 +104,14 @@ fun RecordAudioButtonRecording(
seconds += 1
}
}
val activity = LocalContext.current as Activity
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a LocalActivity already, so it can be even val activity = LocalActivity.current 😎

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aaaaaaaa too late now :(

@alexandreferris alexandreferris merged commit 0ce231e into release/candidate Aug 3, 2023
13 checks passed
@alexandreferris alexandreferris deleted the fix/screen_lock_when_recording_audio branch August 3, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants