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

Fails to share a link when marshmallow's battery saver is ON #22

Open
jeekajoo opened this issue Mar 22, 2016 · 4 comments
Open

Fails to share a link when marshmallow's battery saver is ON #22

jeekajoo opened this issue Mar 22, 2016 · 4 comments

Comments

@jeekajoo
Copy link

Hi,
When using battery saver, sharing does not work.
As soon as I tell Android not to optimizeshaarlier, sharing works again.
optim

If we can't get around it, I think it should be at least documented.

Rom: Omnirom
Android: 6.0.1

Thanks
J.

@dimtion dimtion added the bug label Mar 22, 2016
@dimtion
Copy link
Owner

dimtion commented Mar 22, 2016

Thanks for the report, I could reproduce the bug, I'm looking into it.

@dimtion
Copy link
Owner

dimtion commented Mar 22, 2016

It seems that the problem is coming from android "battery saving" system which refuses some connections from background services.
According to the documentation, the app should wait for the right time to do network calls, in order to save battery life.

Temporary, "un-optimising" the application is a good solution. Because the app only makes one or two network calls (in order to post the link), it should have no effect on your battery life. But I understand that it is a suboptimal solution.

@jeekajoo
Copy link
Author

I was trying to understand why Shaarlier is considered as a background app, and I found this:

When an app enters standby mode, network access is disabled, and syncs and scheduled jobs all get shut down. The app won't be able to run any background services. "Using" an app for the purposes of App Standby counts as the user opening the app, starting a foreground service or having its foreground service used by another app, or generating a notification. If none of those things happen, then the app is at risk of being put into standby.
http://arstechnica.com/gadgets/2015/10/android-6-0-marshmallow-thoroughly-reviewed/9/

@dimtion
Copy link
Owner

dimtion commented Jun 8, 2016

Ok, so for the moment it will be a won't fix, if I want to keep the sharing in the background (in a non blocking way) I must use GCM and for this application I don't want to be too dependant on Google services.

The other workaround is to ask the user to "disable battery optimization", but for some reasons, Google remove apps asking for this request.

So, unless I find a way to do the web request in the foreground (I mean called from a foreground thread), the bug won't be fixed. I may document this issue to avoid future surprises from other users.

@dimtion dimtion added the wontfix label Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants