SeriesGuide icon indicating copy to clipboard operation
SeriesGuide copied to clipboard

Android 14: fix sync not getting automatically triggered

Open UweTrottmann opened this issue 1 year ago • 1 comments

Check emails from Stefan with details.

It appears that on Android 14 (API 34) the ContentResolver.isSyncPending(account, authority) API always returns true, regardless if a sync is actually pending.

It appears this happens once ContentResolver.setSyncAutomatically(account, authority, true) is called (even before any ContentResolver.requestSync calls).

The value does not change

  • even after a sync has run (AbstractThreadedSyncAdapter.onPerformSync has completed) or
  • ContentResolver.setSyncAutomatically(account, authority, false) is called.

The account settings UI also always shows the (non-animated) refresh indicator:

Did not find any issues on the Google issue tracker (if that's the right one?) or online, yet. Edit: better link.

User confirmed my observations on the emulator.

Quick fix in #952

Long-term fix is probably switching to WorkManager APIs. Looks like upcoming 2.9 release is a good fit.

  • https://developer.android.com/topic/libraries/architecture/workmanager
  • https://developer.android.com/jetpack/androidx/releases/work#2.9.0-alpha01

UweTrottmann avatar Nov 03 '23 09:11 UweTrottmann

Try to verify this on my own device now that Android 14 has been available for a while.

UweTrottmann avatar Feb 09 '24 06:02 UweTrottmann

Yep, also happens on my own Samsung Android 14 device. So leaving the workaround in.

UweTrottmann avatar May 22 '24 14:05 UweTrottmann