Search in sources :

Example 1 with ChangePinResult

use of com.android.voicemail.PinChanger.ChangePinResult in project android_packages_apps_Dialer by MoKee.

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)

Example 2 with ChangePinResult

use of com.android.voicemail.PinChanger.ChangePinResult 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

ChangePinResult (com.android.voicemail.PinChanger.ChangePinResult)2 ImapConnection (com.android.voicemail.impl.mail.store.ImapConnection)2 IOException (java.io.IOException)2