package com.x1unix.avi.updateManager;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import com.rollbar.android.Rollbar;
import com.x1unix.avi.model.AviSemVersion;

public class OTAUpdateChecker {
    public static void checkForUpdates(final OTAStateListener otaEventListener) {
        OTARepoClientInterface repoClient = OTARestClient.getClient().create(OTARepoClientInterface.class);
        Call<AviSemVersion> call = repoClient.getLatestRelease();
        call.enqueue(new Callback<AviSemVersion>() {
            @Override
            public void onResponse(Call<AviSemVersion>call, Response<AviSemVersion> response) {
                int statusCode = response.code();
                AviSemVersion receivedVersion = response.body();
                AviSemVersion current = AviSemVersion.getApplicationVersion();

                receivedVersion.apply();

                if (current.isYoungerThan(receivedVersion)) {
                    otaEventListener.onUpdateAvailable(receivedVersion, current);
                } else {
                    otaEventListener.onUpdateMissing(receivedVersion, current);
                }
            }

            @Override
            public void onFailure(Call<AviSemVersion>call, Throwable t) {
                // Log error here since request failed
                otaEventListener.onError(t);
                Rollbar.reportException(t, "critical", "Failed to check for updates");
            }
        });
    }
}

@@ -1368,95 +1368,8 @@
 t);%0A
-                Rollbar.reportException(t, %22critical%22, %22Failed to check for updates%22);%0A
     

Remove reporter