add missing controls on managing wifi
authorEugene Crosser <crosser@average.org>
Wed, 1 Feb 2012 21:32:19 +0000 (01:32 +0400)
committerEugene Crosser <crosser@average.org>
Wed, 1 Feb 2012 21:32:19 +0000 (01:32 +0400)
src/org/average/whereami/WhereAmI.java

index 2fed78cbbada79d093932cee1959f7943ea85fa0..9ee5fd14909d3dda81041c4c243babfb31e16da3 100644 (file)
@@ -57,8 +57,10 @@ public class WhereAmI extends Activity
                 tv.setText(str);
                 runningtasks--;
                 if (runningtasks <= 0) {
-                    boolean wifion = wifiman.setWifiEnabled(false);
-                    Log.w(TAG, "disabling wifi result " + wifion);
+                    if (managewifi) {
+                        boolean wifion = wifiman.setWifiEnabled(false);
+                        Log.w(TAG, "disabling wifi result " + wifion);
+                    }
                     Time tm = new Time();
                     tm.setToNow();
                     tvs.setText(R.string.lasttry);
@@ -258,8 +260,10 @@ public class WhereAmI extends Activity
             unregisterReceiver(connChanged);
             connChangedRegistered = false;
         }
-        boolean wifion = wifiman.setWifiEnabled(false);
-        Log.w(TAG, "disabling wifi result " + wifion);
+        if (managewifi) {
+            boolean wifion = wifiman.setWifiEnabled(false);
+            Log.w(TAG, "disabling wifi result " + wifion);
+        }
     }
 
     /** Called when the menu is activated. */