[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] only show app warning if debug is on



commit edd3195ec8a1a08ee58b1b7a177214a9c8462808
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Thu Apr 17 13:39:40 2014 -0400

    only show app warning if debug is on
---
 src/org/torproject/android/Orbot.java |   26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java
index 5e68e92..601b98e 100644
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@ -24,6 +24,7 @@ import android.content.ServiceConnection;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.Editor;
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Configuration;
@@ -282,16 +283,20 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
     
     private void appConflictChecker ()
     {
-    	
-    	String[] badApps = {"com.sec.msc.nts.android.proxy"};
-    	
-    	for (String badApp : badApps)
+    	boolean debug = mPrefs.getBoolean("pref_enable_logging",false);
+
+    	if (debug)
     	{
-    		if (appInstalledOrNot(badApp))
-    		{
-	    		showAlert(getString(R.string.title_error),"Please uninstall or disable this app if you are having problems with Orbot: " + badApp,true);
-	    		break;
-    		}
+	    	String[] badApps = {"com.sec.msc.nts.android.proxy"};
+	    	
+	    	for (String badApp : badApps)
+	    	{
+	    		if (appInstalledOrNot(badApp))
+	    		{
+		    		showAlert("App Conflict","Please disable this app in Android settings if you are having problems with Orbot: " + badApp,true);
+		    		break;
+	    		}
+	    	}
     	}
     }
     
@@ -714,7 +719,8 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
         boolean app_installed = false;
         try
         {
-               pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
+               PackageInfo pi = pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
+               
                app_installed = true;
         }
         catch (PackageManager.NameNotFoundException e)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits