Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
debug msgs improved
Browse files Browse the repository at this point in the history
  • Loading branch information
tjanson committed Mar 12, 2015
1 parent 5aa5c30 commit 8751617
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ private void initWifiScan() {
wifiIntentFilter = new IntentFilter();
wifiIntentFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
this.registerReceiver(wifiBroadcastReceiver, wifiIntentFilter);
log.debug("Registered wifiBroadcastReceiver");
log.debug("Registered WifiBroadcastReceiver");
}

private void updateValuesFromBundle(Bundle savedInstanceState) {
log.debug("Updating values from bundle");
log.debug("Updating values from Bundle");
if (savedInstanceState != null) {
if (savedInstanceState.keySet().contains(LOCATION_KEY)) {
currentLocation = savedInstanceState.getParcelable(LOCATION_KEY);
Expand Down Expand Up @@ -211,10 +211,16 @@ void startLocationUpdates() {
// The final argument to {@code requestLocationUpdates()} is a LocationListener
// (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html).
LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);
log.trace("Requesting GoogleApiClient location updates");
}

void stopLocationUpdates() {
LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, this);
if (googleApiClient.isConnected()) {
LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, this);
log.trace("Stopped location updates");
} else {
log.warn("Attempted to stop location updates, but not connected");
}
}

@Override
Expand All @@ -229,6 +235,7 @@ public void onLocationChanged(Location location) {
protected void onStart() {
super.onStart();
googleApiClient.connect();
log.trace("Connecting GoogleApiClient ...");
}

@Override
Expand Down Expand Up @@ -283,12 +290,12 @@ public void onConnected(Bundle connectionHint) {

@Override
public void onConnectionFailed(ConnectionResult result) {
log.warn("Connection failed: ConnectionResult.getErrorCode() = {}", result.getErrorCode());
log.warn("GoogleApiClient connection failed: ConnectionResult.getErrorCode() = {}", result.getErrorCode());
}

@Override
public void onConnectionSuspended(int cause) {
log.info("Connection suspended");
log.info("GoogleApiClient connection suspended, attempting reconnect");
googleApiClient.connect();
}
/**
Expand Down

0 comments on commit 8751617

Please sign in to comment.