Search in sources :

Example 1 with BackupDisabledException

use of com.zegoggles.smssync.service.exception.BackupDisabledException 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));
    }
}
Also used : BackupState(com.zegoggles.smssync.service.state.BackupState) MissingPermissionException(com.zegoggles.smssync.service.exception.MissingPermissionException) MessagingException(com.fsck.k9.mail.MessagingException) RequiresLoginException(com.zegoggles.smssync.service.exception.RequiresLoginException) BackupDisabledException(com.zegoggles.smssync.service.exception.BackupDisabledException) DataType(com.zegoggles.smssync.mail.DataType) ConnectivityException(com.zegoggles.smssync.service.exception.ConnectivityException)

Aggregations

MessagingException (com.fsck.k9.mail.MessagingException)1 DataType (com.zegoggles.smssync.mail.DataType)1 BackupDisabledException (com.zegoggles.smssync.service.exception.BackupDisabledException)1 ConnectivityException (com.zegoggles.smssync.service.exception.ConnectivityException)1 MissingPermissionException (com.zegoggles.smssync.service.exception.MissingPermissionException)1 RequiresLoginException (com.zegoggles.smssync.service.exception.RequiresLoginException)1 BackupState (com.zegoggles.smssync.service.state.BackupState)1