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

[tor-commits] [orbot/master] cleaned up binding and logging



commit 493d6e22cdcd7f4836589c696b5c1f2aeb534847
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Wed Jan 25 20:09:33 2012 -0500

    cleaned up binding and logging
---
 src/org/torproject/android/Orbot.java |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java
index 94807e4..b54c05e 100644
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@ -284,7 +284,6 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
 		
 		DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
 			
-		    @Override
 		    public void onClick(DialogInterface dialog, int which) {
 		        switch (which){
 		        case DialogInterface.BUTTON_POSITIVE:
@@ -340,9 +339,9 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
 	protected void onResume() {
 		super.onResume();
 		
-		bindService();
+		if (!mIsBound)
+			bindService();
 	
-		 
 		if (getIntent() == null)
 			return;
 		
@@ -355,7 +354,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
 		{
 			
 			DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
-			    @Override
+			    
 			    public void onClick(DialogInterface dialog, int which) {
 			        switch (which){
 			        case DialogInterface.BUTTON_POSITIVE:
@@ -401,11 +400,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
 		}
 		else
 		{
-			
-			//setTitle(getString(R.string.app_name) + ' ' + getString(R.string.app_version));
-	    
-			NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
-			mNotificationManager.cancelAll();
+		
 			
 			SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
 	
@@ -722,14 +717,14 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
                 mHandler.sendMessage(msg);
         }
 
-                @Override //this was when we displayed the log in the main Activity; can prob take this out now
-                public void logMessage(String value) throws RemoteException {
-                        
-                        Message msg = mHandler.obtainMessage(TorServiceConstants.LOG_MSG);
-                msg.getData().putString(HANDLER_TOR_MSG, value);
-                mHandler.sendMessage(msg);
-                        
-                }
+    
+            public void logMessage(String value) throws RemoteException {
+                    
+                    Message msg = mHandler.obtainMessage(TorServiceConstants.LOG_MSG);
+            msg.getData().putString(HANDLER_TOR_MSG, value);
+            mHandler.sendMessage(msg);
+                    
+            }
     };
     
 



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