Search in sources :

Example 1 with ImapConnection

use of com.android.voicemail.impl.mail.store.ImapConnection in project android_packages_apps_Dialer by LineageOS.

the class ImapHelper method changeVoicemailTuiLanguage.

public void changeVoicemailTuiLanguage(String languageCode) throws MessagingException {
    ImapConnection connection = imapStore.getConnection();
    try {
        String command = getConfig().getProtocol().getCommand(OmtpConstants.IMAP_CHANGE_VM_LANG_FORMAT);
        connection.sendCommand(String.format(Locale.US, command, languageCode), true);
    } catch (IOException ioe) {
        LogUtils.e(TAG, ioe.toString());
    } finally {
        connection.destroyResponses();
    }
}
Also used : IOException(java.io.IOException) ImapConnection(com.android.voicemail.impl.mail.store.ImapConnection)

Example 2 with ImapConnection

use of com.android.voicemail.impl.mail.store.ImapConnection in project android_packages_apps_Dialer by LineageOS.

the class ImapHelper method closeNewUserTutorial.

public void closeNewUserTutorial() throws MessagingException {
    ImapConnection connection = imapStore.getConnection();
    try {
        String command = getConfig().getProtocol().getCommand(OmtpConstants.IMAP_CLOSE_NUT);
        connection.executeSimpleCommand(command, false);
    } catch (IOException ioe) {
        throw new MessagingException(MessagingException.SERVER_ERROR, ioe.toString());
    } finally {
        connection.destroyResponses();
    }
}
Also used : MessagingException(com.android.voicemail.impl.mail.MessagingException) IOException(java.io.IOException) ImapConnection(com.android.voicemail.impl.mail.store.ImapConnection)

Example 3 with ImapConnection

use of com.android.voicemail.impl.mail.store.ImapConnection in project android_packages_apps_Dialer by LineageOS.

the class ImapHelper method changePin.

@ChangePinResult
public int changePin(String oldPin, String newPin) throws MessagingException {
    ImapConnection connection = imapStore.getConnection();
    try {
        String command = getConfig().getProtocol().getCommand(OmtpConstants.IMAP_CHANGE_TUI_PWD_FORMAT);
        connection.sendCommand(String.format(Locale.US, command, newPin, oldPin), true);
        return getChangePinResultFromImapResponse(connection.readResponse());
    } catch (IOException ioe) {
        VvmLog.e(TAG, "changePin: ", ioe);
        return PinChanger.CHANGE_PIN_SYSTEM_ERROR;
    } finally {
        connection.destroyResponses();
    }
}
Also used : IOException(java.io.IOException) ImapConnection(com.android.voicemail.impl.mail.store.ImapConnection) ChangePinResult(com.android.voicemail.PinChanger.ChangePinResult)

Aggregations

ImapConnection (com.android.voicemail.impl.mail.store.ImapConnection)3 IOException (java.io.IOException)3 ChangePinResult (com.android.voicemail.PinChanger.ChangePinResult)1 MessagingException (com.android.voicemail.impl.mail.MessagingException)1