Syncthing-android: Syncthing on Android Oreo

Created on 21 Nov 2017  路  8Comments  路  Source: syncthing/syncthing-android

Starting this bug regarding the "Apps Using Battery" problem on Android Oreo.

It is my understanding that their are API changes that can be adopted to get Syncthing removed from this dialog and handled better as a background application.

Other Apps that sync data do not appear in this dialog.
(Signal, Google Drive, WhatsApp, etc)

It should be feasible to get Syncthing shifted and alleviate its numerous problems with running in background (which I presume are all related)

pr-welcome frozen-due-to-age

Most helpful comment

Here is the migration guide from Android on this issue

https://developer.android.com/about/versions/oreo/background.html

All 8 comments

Perhaps other applications genuinely do not run in the background all the time like syncthing does.

Raising a general "go work it out" issue doesn't provide a lot of encouragement, and these sort of issues are always better accepted with links to documentation or code examples.

Its my understanding that newer API's exist which Android wants Apps to shift over to, and once that occurs these "annoyance" dialogs will disappear.

As for the apps listed, I can only speak to Signal, which definitely keeps a background daemon running at all times.

This problem is unique only to a select few, often older apps.

I am not an expert in android development, so I can't give you more specifics.
I do know this is a solvable issue.

Here is the migration guide from Android on this issue

https://developer.android.com/about/versions/oreo/background.html

Even after fixing https://github.com/syncthing/syncthing-android/issues/966 the notification about "Syncthing is using battery" is still there. It's kind of worse now, as there are two notifications about Syncthing now - one from the app itself, and other from the operating system :|

screenshot_20171208-082614

From the link posted by @GinoBombino, this seems to be caused by the fact that we are listening for wifi/battery events. Unfortunately, that is not something we can easily change. There are some alternative APIs, but I don't think the Syncthing app would be able to work with those like it does now. It would basically require a complete rewrite of the app.

Alternatively, you might check out Syncthing Lite (alpha state).

So this bug is basically asking Syncthing to move over to the new JobScheduler API?

Seems like a good move, not just to get rid of the annoying notifications, but also just in general. Continuously running a foreground service just to listen to Wi-Fi and power events doesn't seem like good practice.

Feel free to make a pull request addressing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nutomic picture Nutomic  路  5Comments

vladipus picture vladipus  路  8Comments

reverse-unina picture reverse-unina  路  3Comments

Dmole picture Dmole  路  7Comments

klausenbusk picture klausenbusk  路  9Comments