diff options
author | vng <viktor.govako@gmail.com> | 2014-05-12 14:15:23 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:15:25 +0300 |
commit | 5a92aef1fa1e068550b9c1e86b8ca488b163b6be (patch) | |
tree | 754b80f1fa266d0d2e8ec2aa0267d83197344186 /android | |
parent | b31d264ceb9acb050cd22f49bcb7c10250780a49 (diff) |
[android][location] Added some additional logs if enabled.
Diffstat (limited to 'android')
-rw-r--r-- | android/src/com/mapswithme/maps/location/LocationService.java | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/location/WifiLocation.java | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/location/LocationService.java b/android/src/com/mapswithme/maps/location/LocationService.java index b00fcd3ba3..e6fed68b8b 100644 --- a/android/src/com/mapswithme/maps/location/LocationService.java +++ b/android/src/com/mapswithme/maps/location/LocationService.java @@ -157,6 +157,8 @@ public class LocationService implements { if (mWifiScanner == null) mWifiScanner = new WifiLocation(); + + mLogger.d("Invoke WiFi scanner."); mWifiScanner.startScan(mApplication, this); } } diff --git a/android/src/com/mapswithme/maps/location/WifiLocation.java b/android/src/com/mapswithme/maps/location/WifiLocation.java index 6e30b2b44d..82a97839e5 100644 --- a/android/src/com/mapswithme/maps/location/WifiLocation.java +++ b/android/src/com/mapswithme/maps/location/WifiLocation.java @@ -58,7 +58,10 @@ public class WifiLocation extends BroadcastReceiver mWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); context.registerReceiver(this, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); if (mWifi.startScan()) + { + mLogger.d("WiFi scan is started."); return true; + } else { // onReceive() will never be called on fail @@ -67,12 +70,15 @@ public class WifiLocation extends BroadcastReceiver return false; } } + // Already in progress + mLogger.d("WiFi scan is already in progress."); return true; } public void stopScan(Context context) { + mLogger.d("WiFi scan is stopped."); context.unregisterReceiver(this); mWifi = null; } @@ -112,6 +118,8 @@ public class WifiLocation extends BroadcastReceiver final StringBuilder json = new StringBuilder("{\"version\":\"2.0\""); appendID(json); + final boolean statsEnabled = Statistics.INSTANCE.isStatisticsEnabled(context); + boolean wifiHeaderAdded = false; List<ScanResult> results = mWifi.getScanResults(); for (ScanResult r : results) @@ -127,7 +135,7 @@ public class WifiLocation extends BroadcastReceiver json.append(r.BSSID); json.append("\",\"ss\":\""); json.append(String.valueOf(r.level)); - if (Statistics.INSTANCE.isStatisticsEnabled(context)) + if (statsEnabled) { json.append("\",\"ssid\":\""); json.append(r.SSID == null ? " " : r.SSID); @@ -145,7 +153,7 @@ public class WifiLocation extends BroadcastReceiver json.append("]"); } - if (Statistics.INSTANCE.isStatisticsEnabled(context)) + if (statsEnabled) { final Location l = mObserver.getLastGPSLocation(); if (l != null) |