1
0
mirror of https://github.com/etesync/android synced 2025-01-11 08:10:58 +00:00

Catch IllegalStateExceptions in the account changed receiver.

These are bad, and shouldn't happen, but ignoring them is not
the end of the world, especially since I plan on overhauling this
code very soon (probably remove).

So for now, we'll just ignore them.
This commit is contained in:
Tom Hacohen 2019-01-07 21:50:54 +00:00
parent 62beaf7083
commit c27a8b44ac

View File

@ -22,7 +22,11 @@ class AccountsChangedReceiver : BroadcastReceiver() {
if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION == intent.action) { if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION == intent.action) {
val serviceIntent = Intent(context, AccountUpdateService::class.java) val serviceIntent = Intent(context, AccountUpdateService::class.java)
serviceIntent.action = AccountUpdateService.ACTION_ACCOUNTS_UPDATED serviceIntent.action = AccountUpdateService.ACTION_ACCOUNTS_UPDATED
context.startService(serviceIntent) try {
context.startService(serviceIntent)
} catch (e: IllegalStateException) {
App.log.warning("Got an illegal state exception! Ignoring...")
}
for (listener in listeners) for (listener in listeners)
listener.onAccountsUpdated(null) listener.onAccountsUpdated(null)