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 crash when starting the service to handle a connect request #1710

Merged
merged 3 commits into from
May 4, 2020

Conversation

jvff
Copy link
Contributor

@jvff jvff commented May 4, 2020

A few crashes with an IllegalStateException when starting the service were reported on newer Android versions. Apparently, the cause is that a service can't be requested to be started without either being the result of a user interaction or having a promise that the service will be a foreground service. In theory, this rule is not applied for apps in a dynamic whitelist. This whitelist seems to be getting stricter with every release, since the crashes appear with the frequency increasing with the Android version.

This PR fixes the issue by promising on those newer Android versions that the service will be a foreground service.

Git checklist:


This change is Reviewable

@jvff jvff requested a review from pinkisemils May 4, 2020 18:49
Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@jvff jvff force-pushed the fix-start-service-crash branch from 6214b32 to 684902e Compare May 4, 2020 19:48
@jvff jvff merged commit 635e67b into master May 4, 2020
@jvff jvff deleted the fix-start-service-crash branch May 4, 2020 20:12
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.

2 participants