private void analyseInitLocation(Location l) { if (l != null) { myCurrentAccuracy = l.getAccuracy(); long passedTime = System.currentTimeMillis() - l.getTime(); Log.d( LOG_TAG, "Passed time since last location event=" + (passedTime / 1000f / 10f) + " minutes"); if (passedTime <= MAX_TIME_SINCE_LAST_UPDATE_IN_MS) onLocationChanged(l); } else { GeoUtils.enableLocationProvidersIfNeeded(myActivity); } }
private void analyseInitLocation(Location l) { if (l != null) { myCurrentAccuracy = l.getAccuracy(); long passedTime = System.currentTimeMillis() - l.getTime(); Log.i(LOG_TAG, "Last known pos accuracy=" + myCurrentAccuracy); Log.i(LOG_TAG, "Last known pos age=" + (passedTime / 1000f / 10f) + " minutes"); if (passedTime <= MAX_TIME_SINCE_LAST_UPDATE_IN_MS) { onLocationChanged(l); } else { Log.i( LOG_TAG, "Last known pos age was to old to use it " + "as a current position, will now wait " + "for position signal"); myCurrentAccuracy = 1000; // 1000m } } else { GeoUtils.enableLocationProvidersIfNeeded(myActivity); } }