From 6fda256c5dde9bf1e8b030ef4ddca347c3ee069c Mon Sep 17 00:00:00 2001 From: Igor Oliveira Date: Wed, 27 Jun 2018 12:12:22 -0300 Subject: [PATCH] Bug 26528 - Don't allow Fennec to use UpdateService when installed through the app store App stores such as Google Play or F-Droid have their own update service. The Fennec UpdateService should be used just when the user installs it by themselves. --- .../src/main/java/org/mozilla/gecko/util/ContextUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java index 4fb88ea41574c..2487637613783 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java @@ -17,6 +17,7 @@ import android.text.TextUtils; public class ContextUtils { private static final String INSTALLER_GOOGLE_PLAY = "com.android.vending"; + private static final String INSTALLER_FDROID = "org.fdroid.fdroid"; private ContextUtils() {} @@ -41,14 +42,14 @@ public class ContextUtils { } } - public static boolean isInstalledFromGooglePlay(final Context context) { + public static boolean isInstalledFromAppStore(final Context context) { final String installerPackageName = context.getPackageManager().getInstallerPackageName(context.getPackageName()); if (TextUtils.isEmpty(installerPackageName)) { return false; } - return INSTALLER_GOOGLE_PLAY.equals(installerPackageName); + return INSTALLER_GOOGLE_PLAY.equals(installerPackageName) || INSTALLER_FDROID.equals(installerPackageName); } public static boolean isApplicationDebuggable(final @NonNull Context context) { -- GitLab