use of com.zegoggles.smssync.service.exception.ConnectivityException in project sms-backup-plus by jberkel.
the class SmsBackupService method backup.
private void backup(BackupType backupType) {
getNotifier().cancel(NOTIFICATION_ID_WARNING);
try {
// set initial state
mState = new BackupState(INITIAL, 0, 0, backupType, null, null);
EnumSet<DataType> enabledTypes = getEnabledBackupTypes();
checkPermissions(enabledTypes);
if (backupType != SKIP) {
checkCredentials();
if (getPreferences().isUseOldScheduler()) {
legacyCheckConnectivity();
}
}
appLog(R.string.app_log_start_backup, backupType);
getBackupTask().execute(getBackupConfig(backupType, enabledTypes, getBackupImapStore()));
} catch (MessagingException e) {
Log.w(TAG, e);
moveToState(mState.transition(ERROR, e));
} catch (ConnectivityException e) {
moveToState(mState.transition(ERROR, e));
} catch (RequiresLoginException e) {
appLog(R.string.app_log_missing_credentials);
moveToState(mState.transition(ERROR, e));
} catch (BackupDisabledException e) {
moveToState(mState.transition(FINISHED_BACKUP, e));
} catch (MissingPermissionException e) {
moveToState(mState.transition(ERROR, e));
}
}
Aggregations