aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-20 23:56:04 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-20 23:56:04 +0200
commitca7672d50136e2b7a5b215fb8d822510ebcc40bd (patch)
tree70282342f40d4da85c68b210c5271a2567ffd50f /src/main
parentd32be8ae19068be9683d166407521415d5772192 (diff)
fix bug in Updater
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/UpdaterActivity.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
index 9e35d7ebf..15d680a42 100644
--- a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
@@ -13,7 +13,6 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
-import android.os.Environment;
import android.os.PowerManager;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
@@ -48,8 +47,6 @@ public class UpdaterActivity extends XmppActivity {
String store;
ProgressDialog mProgressDialog;
DownloadTask downloadTask;
- XmppConnectionService mXmppConnectionService;
- private boolean mUseTor;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -57,10 +54,6 @@ public class UpdaterActivity extends XmppActivity {
//set activity
setContentView(R.layout.activity_updater);
- this.mUseTor = false;
- if (mXmppConnectionService != null) {
- this.mUseTor = mXmppConnectionService.useTorToConnect();
- }
this.mTheme = findTheme();
setTheme(this.mTheme);
@@ -291,11 +284,13 @@ public class UpdaterActivity extends XmppActivity {
private class DownloadTask extends AsyncTask<String, Integer, String> {
- File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + FileBackend.getAppUpdateDirectory());
+ File dir = new File(FileBackend.getAppUpdateDirectory());
File file = new File(dir, FileName);
private Context context;
private PowerManager.WakeLock mWakeLock;
private long startTime = 0;
+ XmppConnectionService xmppConnectionService;
+ private boolean mUseTor;
public DownloadTask(Context context) {
this.context = context;
@@ -311,6 +306,7 @@ public class UpdaterActivity extends XmppActivity {
if (pm != null) {
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, getClass().getName());
mWakeLock.acquire();
+ mUseTor = xmppConnectionService != null && xmppConnectionService.useTorToConnect();
}
mProgressDialog.show();
}