From e80c3bf162424a3fc83e6f5b75f7e2adc2d731f1 Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Mon, 5 May 2014 00:00:01 -0400 Subject: [PATCH] check if installed apps are enabled --- src/org/torproject/android/Orbot.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index 21f304d1..bdfdc5be 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -728,18 +728,15 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic private boolean appInstalledOrNot(String uri) { PackageManager pm = getPackageManager(); - boolean app_installed = false; try { PackageInfo pi = pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); - - app_installed = true; + return pi.applicationInfo.enabled; } catch (PackageManager.NameNotFoundException e) { - app_installed = false; + return false; } - return app_installed ; } /*