Skip to content

Commit

Permalink
chore(geofence): Fixed logging in _setLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanclevertap committed Sep 1, 2020
1 parent 4e25f6e commit 12bcd88
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6842,7 +6842,7 @@ private Future<?> _setLocation(Location location) {
if (location == null) return null;

locationFromUser = location;
Logger.v("Location updated (" + location.getLatitude() + ", " + location.getLongitude() + ")");
getConfigLogger().verbose(getAccountId(),"Location updated (" + location.getLatitude() + ", " + location.getLongitude() + ")");

// only queue the location ping if we are in the foreground
if (!isLocationForGeofence()&&!isAppForeground()) return null;
Expand All @@ -6855,11 +6855,11 @@ private Future<?> _setLocation(Location location) {
if (isLocationForGeofence() && now > (lastLocationPingTimeForGeofence + Constants.LOCATION_PING_INTERVAL_IN_SECONDS)) {
future = queueEvent(context, new JSONObject(), Constants.PING_EVENT);
lastLocationPingTimeForGeofence = now;
Logger.v("Queuing location ping event for geofence location (" + location.getLatitude() + ", " + location.getLongitude() + ")");
getConfigLogger().verbose(getAccountId(),"Queuing location ping event for geofence location (" + location.getLatitude() + ", " + location.getLongitude() + ")");
} else if (!isLocationForGeofence() && now > (lastLocationPingTime + Constants.LOCATION_PING_INTERVAL_IN_SECONDS)) {
future = queueEvent(context, new JSONObject(), Constants.PING_EVENT);
lastLocationPingTime = now;
Logger.v("Queuing location ping event for location (" + location.getLatitude() + ", " + location.getLongitude() + ")");
getConfigLogger().verbose(getAccountId(),"Queuing location ping event for location (" + location.getLatitude() + ", " + location.getLongitude() + ")");
}

return future;
Expand Down

0 comments on commit 12bcd88

Please sign in to comment.