summaryrefslogtreecommitdiff
path: root/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/fatweb/java/se.leap.bitmaskclient/appUpdate')
-rw-r--r--app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java6
-rw-r--r--app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/UpdateDownloadManager.java38
2 files changed, 28 insertions, 16 deletions
diff --git a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java
index 46c0457b..9fd3dfb3 100644
--- a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java
+++ b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java
@@ -60,6 +60,12 @@ public class DownloadService extends JobIntentService implements UpdateDownloadM
updateDownloadManager.handleIntent(intent);
}
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ updateDownloadManager.onDestroy();
+ }
+
/**
* Convenience method for enqueuing work in to this service.
*/
diff --git a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/UpdateDownloadManager.java b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/UpdateDownloadManager.java
index 109164c5..37da6342 100644
--- a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/UpdateDownloadManager.java
+++ b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/UpdateDownloadManager.java
@@ -16,21 +16,6 @@
*/
package se.leap.bitmaskclient.appUpdate;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.ResultReceiver;
-import android.util.Log;
-
-import java.io.File;
-
-import okhttp3.OkHttpClient;
-import pgpverify.Logger;
-import pgpverify.PgpVerifier;
-import se.leap.bitmaskclient.BuildConfig;
-import se.leap.bitmaskclient.R;
-import se.leap.bitmaskclient.providersetup.connectivity.OkHttpClientGenerator;
-
import static android.text.TextUtils.isEmpty;
import static se.leap.bitmaskclient.appUpdate.DownloadService.DOWNLOAD_FAILED;
import static se.leap.bitmaskclient.appUpdate.DownloadService.DOWNLOAD_PROGRESS;
@@ -52,6 +37,22 @@ import static se.leap.bitmaskclient.providersetup.ProviderAPI.DELAY;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.PARAMETERS;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.RECEIVER_KEY;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.ResultReceiver;
+import android.util.Log;
+
+import java.io.File;
+
+import de.blinkt.openvpn.core.VpnStatus;
+import okhttp3.OkHttpClient;
+import pgpverify.Logger;
+import pgpverify.PgpVerifier;
+import se.leap.bitmaskclient.BuildConfig;
+import se.leap.bitmaskclient.R;
+import se.leap.bitmaskclient.providersetup.connectivity.OkHttpClientGenerator;
+
public class UpdateDownloadManager implements Logger, DownloadConnector.DownloadProgress {
@@ -63,7 +64,7 @@ public class UpdateDownloadManager implements Logger, DownloadConnector.Download
private Context context;
- private PgpVerifier pgpVerifier;
+ private final PgpVerifier pgpVerifier;
private DownloadServiceCallback serviceCallback;
OkHttpClientGenerator clientGenerator;
@@ -76,6 +77,11 @@ public class UpdateDownloadManager implements Logger, DownloadConnector.Download
serviceCallback = callback;
}
+ public void onDestroy() {
+ serviceCallback = null;
+ context = null;
+ }
+
//pgpverify Logger interface
@Override
public void log(String s) {