Search in sources :

Example 1 with UseEncryption

use of com.voipgrid.vialer.api.models.UseEncryption in project vialer-android by VoIPGRID.

the class UpdateHelper method enableSecureCalling.

/**
 * Migrate secure calling permissions to use secure calling by default.
 * V5_2
 */
private void enableSecureCalling() {
    AccountHelper accountHelper = new AccountHelper(mContext);
    Api mApi = ServiceGenerator.createService(mContext, Api.class, mContext.getString(R.string.api_url), accountHelper.getEmail(), accountHelper.getPassword());
    Call<UseEncryption> call = mApi.useEncryption(new UseEncryption(true));
    try {
        Response response = call.execute();
        if (!response.isSuccessful()) {
            handleApiFailure(response.code());
        }
    } catch (IOException e) {
        handleApiFailure(0);
    }
}
Also used : Response(retrofit2.Response) Api(com.voipgrid.vialer.api.Api) UseEncryption(com.voipgrid.vialer.api.models.UseEncryption) IOException(java.io.IOException)

Aggregations

Api (com.voipgrid.vialer.api.Api)1 UseEncryption (com.voipgrid.vialer.api.models.UseEncryption)1 IOException (java.io.IOException)1 Response (retrofit2.Response)1