1
0
mirror of https://github.com/etesync/android synced 2024-12-23 07:08:16 +00:00

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).
This commit is contained in:
Tom Hacohen 2020-09-06 13:20:33 +03:00
parent c90bf78dc5
commit c6c3dd35f6

View File

@ -110,6 +110,9 @@ abstract class SyncAdapterService : Service() {
try { try {
onPerformSyncDo(account, extras, authority, provider, syncResult) 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) { } catch (e: Exceptions.ServiceUnavailableException) {
syncResult.stats.numIoExceptions++ syncResult.stats.numIoExceptions++
syncResult.delayUntil = if (e.retryAfter > 0) e.retryAfter else Constants.DEFAULT_RETRY_DELAY syncResult.delayUntil = if (e.retryAfter > 0) e.retryAfter else Constants.DEFAULT_RETRY_DELAY