diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-01-29 21:07:33 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-01-29 21:07:33 +0100 |
commit | bed3b18312174edd1f8972d34bcb1e2bc22418c0 (patch) | |
tree | d7da98dc94dfefec34527dfc1a3795cb53e637fd /src/main/java/de/pixart/messenger/ui/ConversationActivity.java | |
parent | e15df13f4c8766c073feddb87094913597c53b14 (diff) |
check if app is installedFromPlayStore and use upcoming playstore site for updates
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index b7018b58c..274b51d8a 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -483,7 +483,7 @@ public class ConversationActivity extends XmppActivity menuInviteContact.setVisible(false); menuAttach.setVisible(false); menuClearHistory.setVisible(false); - if (installedFromFDroid()) { + if (xmppConnectionService.installedFromFDroid()) { menuUpdater.setVisible(false); } else { menuUpdater.setVisible(true); @@ -523,14 +523,6 @@ public class ConversationActivity extends XmppActivity return super.onCreateOptionsMenu(menu); } - private boolean installedFromFDroid() { - final PackageManager packageManager = this.getPackageManager(); - final String packageID = BuildConfig.APPLICATION_ID; - final String installedFrom = packageManager.getInstallerPackageName(packageID); - Log.d(Config.LOGTAG, "Messenger installed from " + installedFrom); - return installedFrom != null && installedFrom.contains("fdroid"); - } - private Runnable addOmemoDebuggerRunnable = new Runnable() { @Override public void run() { @@ -1386,7 +1378,7 @@ public class ConversationActivity extends XmppActivity if (xmppConnectionService.getAccounts().size() != 0) { if (xmppConnectionService.hasInternetConnection()) { if (xmppConnectionService.isWIFI() || (xmppConnectionService.isMobile() && !xmppConnectionService.isMobileRoaming())) { - if (!installedFromFDroid()) { + if (!xmppConnectionService.installedFromFDroid()) { AppUpdate(); } } @@ -1432,10 +1424,11 @@ public class ConversationActivity extends XmppActivity if (!ExceptionHelper.checkForCrash(this, this.xmppConnectionService) && !mRedirected.get()) { openBatteryOptimizationDialogIfNeeded(); + if (!xmppConnectionService.installedFromFDroid() && !xmppConnectionService.installedFromPlayStore()) { + openInstallFromUnknownSourcesDialogIfNeeded(); + } } - if (!installedFromFDroid()) { - openInstallFromUnknownSourcesDialogIfNeeded(); - } + if (isConversationsOverviewVisable() && isConversationsOverviewHideable()) { xmppConnectionService.getNotificationService().setOpenConversation(null); } else { |