Index: mobile/android/thirdparty/org/adblockplus/browser/BrowserAppUtils.java |
=================================================================== |
--- a/mobile/android/thirdparty/org/adblockplus/browser/BrowserAppUtils.java |
+++ b/mobile/android/thirdparty/org/adblockplus/browser/BrowserAppUtils.java |
@@ -12,16 +12,17 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
package org.adblockplus.browser; |
+import android.content.Context; |
import android.util.Log; |
import android.view.MenuItem; |
import org.mozilla.gecko.Tab; |
import org.mozilla.gecko.Tabs; |
import org.mozilla.gecko.util.NativeJSObject; |
import org.mozilla.gecko.util.ThreadUtils; |
@@ -108,13 +109,19 @@ public class BrowserAppUtils |
@Override |
public void onApiRequestFailed(String errorMessage) |
{ |
Log.e(TAG, "whitelistSite failed: " + errorMessage); |
} |
}, url, item.isChecked()); |
} |
+ public static boolean wasInstalledFromPlayStore(final Context context) |
+ { |
+ final String installer = context.getPackageManager().getInstallerPackageName(context.getPackageName()); |
+ return "com.android.vending".equals(installer); |
+ } |
+ |
private BrowserAppUtils() |
{ |
// Shouldn't be instantiated. |
} |
} |