Explicitly handle securityException for tasks permissions.

It should be handled automatically by the sync adapter's
onSecurityException function. I have no idea why it doesn't work
automatically for some users (but is fine for me).
pull/127/head
Tom Hacohen 4 years ago
parent c90bf78dc5
commit c6c3dd35f6

@ -110,6 +110,9 @@ abstract class SyncAdapterService : Service() {
try {
onPerformSyncDo(account, extras, authority, provider, syncResult)
} catch (e: SecurityException) {
// Shouldn't be needed - not sure why it doesn't fail
onSecurityException(account, extras, authority, syncResult)
} catch (e: Exceptions.ServiceUnavailableException) {
syncResult.stats.numIoExceptions++
syncResult.delayUntil = if (e.retryAfter > 0) e.retryAfter else Constants.DEFAULT_RETRY_DELAY

Loading…
Cancel
Save