commit e80c3bf162424a3fc83e6f5b75f7e2adc2d731f1 Author: Nathan Freitas nathan@freitas.net Date: Mon May 5 00:00:01 2014 -0400
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 21f304d..bdfdc5b 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 ; } /*
tor-commits@lists.torproject.org