aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-08-05 12:59:32 +0200
committerChristian Schneppe <christian@pix-art.de>2018-08-05 12:59:32 +0200
commit555e5a8597d7967ecae0818c0f23d8218502197b (patch)
tree8f7477a086eddac7dfb44a921cf7240041df398a
parentb2cc0dcf5de9c23ab22232bd9fb8ab03bc4649fb (diff)
don't use internal updater if installed from F-Droid or Google Play Store
fixes #220
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationsActivity.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
index 6067d03f9..30c54990f 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
@@ -93,6 +93,7 @@ import de.pixart.messenger.utils.XmppUri;
import de.pixart.messenger.xmpp.OnUpdateBlocklist;
import de.pixart.messenger.xmpp.chatstate.ChatState;
+import static de.pixart.messenger.services.XmppConnectionService.FDroid;
import static de.pixart.messenger.services.XmppConnectionService.PlayStore;
import static de.pixart.messenger.ui.ConversationFragment.REQUEST_DECRYPT_PGP;
import static de.pixart.messenger.ui.SettingsActivity.USE_BUNDLED_EMOJIS;
@@ -937,9 +938,6 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
}
protected void AppUpdate(String Store) {
- if (Store == null) {
- return;
- }
String PREFS_NAME = "UpdateTimeStamp";
SharedPreferences UpdateTimeStamp = getApplicationContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
long lastUpdateTime = UpdateTimeStamp.getLong("lastUpdateTime", 0);
@@ -950,8 +948,10 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
editor.putLong("lastUpdateTime", lastUpdateTime);
editor.apply();
Log.d(Config.LOGTAG, "AppUpdater: CurrentTime: " + lastUpdateTime);
- if (!installFromUnknownSourceAllowed() && !Store.equals(PlayStore)) {
+ if (!installFromUnknownSourceAllowed() && Store == null) {
openInstallFromUnknownSourcesDialogIfNeeded();
+ } else if (Store != null && (Store.equals(PlayStore) || Store.equals(FDroid))) {
+ Log.d(Config.LOGTAG, "AppUpdater aborted because app store is " + Store);
} else {
UpdateService task = new UpdateService(this, Store, xmppConnectionService);
task.executeOnExecutor(UpdateService.THREAD_POOL_EXECUTOR, "false");