Rewriting scheduling mechanism
Hi fengshaun,
thanks for the merge !23 (merged).
I propose the following changes after merge of !23 (merged).
The currently implemented scheduling mechanism with JobIntentService
is deprecated [0]. On my phone (Lineage OS, xiaomi redmi note7) it often suffers from aggressive doze restrictions making the scheduled BackupBackgroundService
hardly ever run.
I suggest we migrate the job to WorkManger [1], android's intended way to schedule long running tasks. This will greatly simplify the code base as we no longer need android.permission.GET_ACCOUNTS
and the boilerplate code Stub*
in the code base (StubAuthenticator and such).
I already started with the migration. But it is still work-in-progress. Some initial testing shows that it runs more stable, but still affected by doze. I'll keep you updated.
[0] - https://developer.android.com/reference/androidx/core/app/JobIntentService
[1] - https://developer.android.com/topic/libraries/architecture/workmanager