From d8ee029f3743bded09641343926151bab0254d52 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 29 Jul 2018 15:30:09 +0200 Subject: fix crash during lookup for updates --- src/main/java/de/pixart/messenger/services/UpdateService.java | 3 +-- src/main/java/de/pixart/messenger/ui/ConversationsActivity.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/services/UpdateService.java b/src/main/java/de/pixart/messenger/services/UpdateService.java index da940f7b7..7e636b8e6 100644 --- a/src/main/java/de/pixart/messenger/services/UpdateService.java +++ b/src/main/java/de/pixart/messenger/services/UpdateService.java @@ -30,14 +30,13 @@ import static de.pixart.messenger.http.HttpConnectionManager.getProxy; import static de.pixart.messenger.services.NotificationService.UPDATE_NOTIFICATION_ID; public class UpdateService extends AsyncTask { - XmppConnectionService mXmppConnectionService; private boolean mUseTor; private Context context; private boolean playstore; public UpdateService() { } - public UpdateService(Context context, boolean PlayStore) { + public UpdateService(Context context, boolean PlayStore, XmppConnectionService mXmppConnectionService) { this.context = context; this.playstore = PlayStore; this.mUseTor = mXmppConnectionService.useTorToConnect(); diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index 91170567d..67618dc65 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -562,7 +562,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio if (!installFromUnknownSourceAllowed() && !xmppConnectionService.installedFromPlayStore()) { openInstallFromUnknownSourcesDialogIfNeeded(); } else { - UpdateService task = new UpdateService(this, xmppConnectionService.installedFromPlayStore()); + UpdateService task = new UpdateService(this, xmppConnectionService.installedFromPlayStore(), xmppConnectionService); task.executeOnExecutor(UpdateService.THREAD_POOL_EXECUTOR, "true"); Log.d(Config.LOGTAG, "AppUpdater started"); } @@ -957,7 +957,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio if (!installFromUnknownSourceAllowed() && !PlayStore) { openInstallFromUnknownSourcesDialogIfNeeded(); } else { - UpdateService task = new UpdateService(this, PlayStore); + UpdateService task = new UpdateService(this, PlayStore, xmppConnectionService); task.executeOnExecutor(UpdateService.THREAD_POOL_EXECUTOR, "false"); Log.d(Config.LOGTAG, "AppUpdater started"); } -- cgit v1.2.3