Lines Matching defs:location
27 import android.location.Location;
28 import android.location.LocationListener;
29 import android.location.LocationManager;
43 * Figures out whether it's twilight time based on the user's location.
156 // Start listening for location updates (default: low power, max 1h, min 10m).
160 // Request the device's location immediately if a previous location isn't available.
207 // Calculate the twilight state based on the current time and location.
209 final Location location = mLastLocation != null ? mLastLocation
211 final TwilightState state = calculateTwilightState(location, currentTimeMillis);
249 public void onLocationChanged(Location location) {
250 if (location != null) {
252 + " provider=" + location.getProvider()
253 + " accuracy=" + location.getAccuracy()
254 + " time=" + location.getTime());
255 mLastLocation = location;
273 * Calculates the twilight state for a specific location and time.
275 * @param location the location to use
277 * @return the calculated {@link TwilightState}, or {@code null} if location is {@code null}
279 private static TwilightState calculateTwilightState(Location location, long timeMillis) {
280 if (location == null) {
285 location.getLongitude(), location.getLatitude());