Home | History | Annotate | Download | only in cts

Lines Matching refs:location

17 package android.location.cts;
21 import android.location.Location;
22 import android.location.SettingInjectorService;
59 new Location("LocationProvider");
61 Location l = createTestLocation();
62 Location location = new Location(l);
63 assertTestLocation(location);
66 new Location((Location) null);
76 Location location = new Location("LocationProvider");
77 location.dump(printer, "");
82 Location location = new Location("");
83 Location dest = new Location("");
85 // set the location to Beijing
86 location.setLatitude(39.9);
87 location.setLongitude(116.4);
91 assertEquals(-128.66, location.bearingTo(dest), DELTA);
94 Location zeroLocation = new Location("");
98 Location testLocation = new Location("");
114 location.bearingTo(null);
125 result = Location.convert(-80.0, Location.FORMAT_DEGREES);
128 result = Location.convert(-80.085, Location.FORMAT_MINUTES);
131 result = Location.convert(-80, Location.FORMAT_MINUTES);
134 result = Location.convert(-80.075, Location.FORMAT_MINUTES);
137 result = Location.convert(-80.075, Location.FORMAT_DEGREES);
140 result = Location.convert(-80.075, Location.FORMAT_SECONDS);
144 Location.convert(-181, Location.FORMAT_SECONDS);
151 Location.convert(181, Location.FORMAT_SECONDS);
158 Location.convert(-80.075, -1);
168 result = Location.convert("-80.075");
171 result = Location.convert("-80:05.10000");
174 result = Location.convert("-80:04:03.00000");
177 result = Location.convert("-80:4:3");
181 Location.convert(null);
188 Location.convert(":");
195 Location.convert("190:4:3");
202 Location.convert("-80:60:3");
209 Location.convert("-80:4:60");
217 Location location = new Location("");
218 location.describeContents();
223 Location.distanceBetween(0, 0, 0, 0, result);
228 Location.distanceBetween(20, 30, -40, 140, result);
234 Location.distanceBetween(20, 30, -40, 140, null);
241 Location.distanceBetween(20, 30, -40, 140, new float[0]);
250 Location zeroLocation = new Location("");
254 Location testLocation = new Location("");
266 Location location = new Location("");
267 assertFalse(location.hasAccuracy());
269 location.setAccuracy(1.0f);
270 assertEquals(1.0, location.getAccuracy(), DELTA);
271 assertTrue(location.hasAccuracy());
273 location.removeAccuracy();
274 assertEquals(0.0, location.getAccuracy(), DELTA);
275 assertFalse(location.hasAccuracy());
279 Location location = new Location("");
280 assertFalse(location.hasVerticalAccuracy());
282 location.setVerticalAccuracyMeters(1.0f);
283 assertEquals(1.0, location.getVerticalAccuracyMeters(), DELTA);
284 assertTrue(location.hasVerticalAccuracy());
288 Location location = new Location("");
289 assertFalse(location.hasSpeedAccuracy());
291 location.setSpeedAccuracyMetersPerSecond(1.0f);
292 assertEquals(1.0, location.getSpeedAccuracyMetersPerSecond(), DELTA);
293 assertTrue(location.hasSpeedAccuracy());
297 Location location = new Location("");
298 assertFalse(location.hasBearingAccuracy());
300 location.setBearingAccuracyDegrees(1.0f);
301 assertEquals(1.0, location.getBearingAccuracyDegrees(), DELTA);
302 assertTrue(location.hasBearingAccuracy());
307 Location location = new Location("");
308 assertFalse(location.hasAltitude());
310 location.setAltitude(1.0);
311 assertEquals(1.0, location.getAltitude(), DELTA);
312 assertTrue(location.hasAltitude());
314 location.removeAltitude();
315 assertEquals(0.0, location.getAltitude(), DELTA);
316 assertFalse(location.hasAltitude());
320 Location location = new Location("");
321 assertFalse(location.hasBearing());
323 location.setBearing(1.0f);
324 assertEquals(1.0, location.getBearing(), DELTA);
325 assertTrue(location.hasBearing());
327 location.setBearing(371.0f);
328 assertEquals(11.0, location.getBearing(), DELTA);
329 assertTrue(location.hasBearing());
331 location.setBearing(-361.0f);
332 assertEquals(359.0, location.getBearing(), DELTA);
333 assertTrue(location.hasBearing());
335 location.removeBearing();
336 assertEquals(0.0, location.getBearing(), DELTA);
337 assertFalse(location.hasBearing());
341 Location location = createTestLocation();
343 assertTestBundle(location.getExtras());
345 location.setExtras(null);
346 assertNull(location.getExtras());
350 Location location = new Location("");
352 location.setLatitude(0);
353 assertEquals(0, location.getLatitude(), DELTA);
355 location.setLatitude(90);
356 assertEquals(90, location.getLatitude(), DELTA);
358 location.setLatitude(-90);
359 assertEquals(-90, location.getLatitude(), DELTA);
363 Location location = new Location("");
365 location.setLongitude(0);
366 assertEquals(0, location.getLongitude(), DELTA);
368 location.setLongitude(180);
369 assertEquals(180, location.getLongitude(), DELTA);
371 location.setLongitude(-180);
372 assertEquals(-180, location.getLongitude(), DELTA);
376 Location location = new Location("");
378 String provider = "Location Provider";
379 location.setProvider(provider);
380 assertEquals(provider, location.getProvider());
382 location.setProvider(null);
383 assertNull(location.getProvider());
387 Location location = new Location("");
388 assertFalse(location.hasSpeed());
390 location.setSpeed(234.0045f);
391 assertEquals(234.0045, location.getSpeed(), DELTA);
392 assertTrue(location.hasSpeed());
394 location.removeSpeed();
395 assertEquals(0.0, location.getSpeed(), DELTA);
396 assertFalse(location.hasSpeed());
400 Location location = new Location("");
402 location.setTime(0);
403 assertEquals(0, location.getTime());
405 location.setTime(Long.MAX_VALUE);
406 assertEquals(Long.MAX_VALUE, location.getTime());
408 location.setTime(12000);
409 assertEquals(12000, location.getTime());
413 Location location = new Location("");
415 location.setElapsedRealtimeNanos(0);
416 assertEquals(0, location.getElapsedRealtimeNanos());
418 location.setElapsedRealtimeNanos(Long.MAX_VALUE);
419 assertEquals(Long.MAX_VALUE, location.getElapsedRealtimeNanos());
421 location.setElapsedRealtimeNanos(12000);
422 assertEquals(12000, location.getElapsedRealtimeNanos());
426 Location location = new Location("");
428 Location loc = createTestLocation();
430 location.set(loc);
431 assertTestLocation(location);
433 location.reset();
434 assertNull(location.getProvider());
435 assertEquals(0, location.getTime());
436 assertEquals(0, location.getLatitude(), DELTA);
437 assertEquals(0, location.getLongitude(), DELTA);
438 assertEquals(0, location.getAltitude(), DELTA);
439 assertFalse(location.hasAltitude());
440 assertEquals(0, location.getSpeed(), DELTA);
441 assertFalse(location.hasSpeed());
442 assertEquals(0, location.getBearing(), DELTA);
443 assertFalse(location.hasBearing());
444 assertEquals(0, location.getAccuracy(), DELTA);
445 assertFalse(location.hasAccuracy());
447 assertEquals(0, location.getVerticalAccuracyMeters(), DELTA);
448 assertEquals(0, location.getSpeedAccuracyMetersPerSecond(), DELTA);
449 assertEquals(0, location.getBearingAccuracyDegrees(), DELTA);
451 assertFalse(location.hasVerticalAccuracy());
452 assertFalse(location.hasSpeedAccuracy());
453 assertFalse(location.hasBearingAccuracy());
455 assertNull(location.getExtras());
459 Location location = createTestLocation();
461 assertNotNull(location.toString());
465 Location location = createTestLocation();
468 location.writeToParcel(parcel, 0);
470 Location newLocation = Location.CREATOR.createFromParcel(parcel);
483 new Intent(c, android.location.SettingInjectorService.class);
528 private void assertTestLocation(Location l) {
544 private Location createTestLocation() {
545 Location l = new Location(TEST_PROVIDER);