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

Bugfix Start Foreground Service When App In Foreground #13065

Merged
merged 5 commits into from
Jun 6, 2024

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Jun 4, 2024

  • Tests written, or not not needed

What does this PR?

Only starts foreground service when app in foreground so we don't came across background crashes anymore
No need to do it for FOREGROUND_SERVICE_MEDIA_PLAYBACK because Media Playback not causing that issue

@tobiasKaminsky
Copy link
Member

Instead of writing own lifecycle, can't we re-use the Android one?
Like we do here:

if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {

@alperozturk96
Copy link
Collaborator Author

alperozturk96 commented Jun 5, 2024

Instead of writing own lifecycle, can't we re-use the Android one? Like we do here:

if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {

Instead of writing own lifecycle, can't we re-use the Android one? Like we do here:

if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {

Instead of writing own lifecycle, can't we re-use the Android one? Like we do here:

if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {

Then we need to add this dependency "androidx.lifecycle:lifecycle-service:2.8.1" to access lifecycle from service. PR is updated.

@alperozturk96 alperozturk96 force-pushed the bugfix/start-foreground-service-in-background branch from 50e398f to 99ec983 Compare June 6, 2024 07:16
Copy link

github-actions bot commented Jun 6, 2024

Codacy

Lint

TypemasterPR
Warnings7070
Errors33

SpotBugs

CategoryBaseNew
Bad practice6464
Correctness6969
Dodgy code346346
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness66
Performance5757
Security1919
Total571571

Copy link

github-actions bot commented Jun 6, 2024

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13065.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@alperozturk96 alperozturk96 merged commit 0580f93 into master Jun 6, 2024
21 checks passed
@delete-merged-branch delete-merged-branch bot deleted the bugfix/start-foreground-service-in-background branch June 6, 2024 10:40
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.30.0 milestone Jun 6, 2024
@alperozturk96
Copy link
Collaborator Author

/backport to stable-3.29

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

Successfully merging this pull request may close these issues.

3 participants