[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] check if installed apps are enabled
commit e80c3bf162424a3fc83e6f5b75f7e2adc2d731f1
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
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 mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits