Loading app/src/main/kotlin/at/bitfire/davdroid/sync/adapter/SyncFrameworkIntegration.kt +4 −4 Original line number Diff line number Diff line Loading @@ -196,8 +196,8 @@ class SyncFrameworkIntegration @Inject constructor( // Android 14+ does not handle pending sync state correctly. // For now we simply always return false // See also sync cancellation in [SyncAdapterImpl.onPerformSync] if (Build.VERSION.SDK_INT >= 34) return flowOf(false) // if (Build.VERSION.SDK_INT >= 34) // return flowOf(false) // Determine the pending state for each data type of the account as separate flows val pendingStateFlows: List<Flow<Boolean>> = dataTypes.mapNotNull { dataType -> Loading Loading @@ -241,11 +241,11 @@ class SyncFrameworkIntegration @Inject constructor( val listener = ContentResolver.addStatusChangeListener( ContentResolver.SYNC_OBSERVER_TYPE_PENDING ) { trySend(anyPendingSync(accounts, authority)) runCatching { trySend(anyPendingSync(accounts, authority)) } } // Emit initial value trySend(anyPendingSync(accounts, authority)) runCatching { trySend(anyPendingSync(accounts, authority)) } // Clean up listener on close awaitClose { ContentResolver.removeStatusChangeListener(listener) } Loading Loading
app/src/main/kotlin/at/bitfire/davdroid/sync/adapter/SyncFrameworkIntegration.kt +4 −4 Original line number Diff line number Diff line Loading @@ -196,8 +196,8 @@ class SyncFrameworkIntegration @Inject constructor( // Android 14+ does not handle pending sync state correctly. // For now we simply always return false // See also sync cancellation in [SyncAdapterImpl.onPerformSync] if (Build.VERSION.SDK_INT >= 34) return flowOf(false) // if (Build.VERSION.SDK_INT >= 34) // return flowOf(false) // Determine the pending state for each data type of the account as separate flows val pendingStateFlows: List<Flow<Boolean>> = dataTypes.mapNotNull { dataType -> Loading Loading @@ -241,11 +241,11 @@ class SyncFrameworkIntegration @Inject constructor( val listener = ContentResolver.addStatusChangeListener( ContentResolver.SYNC_OBSERVER_TYPE_PENDING ) { trySend(anyPendingSync(accounts, authority)) runCatching { trySend(anyPendingSync(accounts, authority)) } } // Emit initial value trySend(anyPendingSync(accounts, authority)) runCatching { trySend(anyPendingSync(accounts, authority)) } // Clean up listener on close awaitClose { ContentResolver.removeStatusChangeListener(listener) } Loading