1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-26 01:06:34 +00:00

Background sync: cancel notifications at the right moment

This commit is contained in:
Loic Blot 2016-03-10 10:53:21 +01:00
parent c01df1b64a
commit 533c7ae3c0

View File

@ -69,6 +69,7 @@ public class SmsSyncAdapter extends AbstractThreadedSyncAdapter {
_client.doPushRequest(null); _client.doPushRequest(null);
OCSMSNotificationUI.cancel(getContext()); OCSMSNotificationUI.cancel(getContext());
} catch (final OCSyncException e) { } catch (final OCSyncException e) {
OCSMSNotificationUI.cancel(getContext());
OCSMSNotificationUI.notify(getContext(), getContext().getString(R.string.fatal_error), OCSMSNotificationUI.notify(getContext(), getContext().getString(R.string.fatal_error),
getContext().getString(e.getErrorId()), OCSMSNotificationType.SYNC_FAILED.ordinal()); getContext().getString(e.getErrorId()), OCSMSNotificationType.SYNC_FAILED.ordinal());
if (e.getErrorType() == OCSyncErrorType.IO) { if (e.getErrorType() == OCSyncErrorType.IO) {
@ -84,8 +85,6 @@ public class SmsSyncAdapter extends AbstractThreadedSyncAdapter {
// UNHANDLED // UNHANDLED
} }
} }
OCSMSNotificationUI.cancel(getContext());
} }
private final AccountManager _accountMgr; private final AccountManager _accountMgr;