Home | History | Annotate | Download | only in cts

Lines Matching refs:location

17 package android.location.cts;
19 import android.location.Location;
23 * Test the {@link Location} values.
26 * 1. Register for location updates.
75 for (Location location : mLocationListener.getReceivedLocationList()) {
76 checkLocationAccuracyFields(softAssert, location,
84 Location location, boolean extendedLocationAccuracyExpected) {
86 + "should have a horizontal accuracy.", location.hasAccuracy());
87 if (location.hasAccuracy()) {
88 softAssert.assertTrue("Location Accuracy should be greater than 0.",
89 location.getAccuracy() > 0);
97 if (location.hasSpeed() && location.getSpeed() > MINIMUM_SPEED_FOR_BEARING) {
99 + "the LocationManager must have bearing accuracies.", location.hasBearingAccuracy());
100 if (location.hasBearingAccuracy()) {
102 location.getBearingAccuracyDegrees() > 0);
107 + "must have a speed accuracy.", location.hasSpeedAccuracy());
108 if (location.hasSpeedAccuracy()) {
110 location.getSpeedAccuracyMetersPerSecond() > 0);
113 + "must have a vertical accuracy.", location.hasVerticalAccuracy());
114 if (location.hasVerticalAccuracy()) {
116 location.getVerticalAccuracyMeters() > 0);
121 * Get the location info from the device
134 // don't check speed of first GNSS location - it may not be ready in some cases
136 for (Location location : mLocationListener.getReceivedLocationList()) {
137 checkLocationRegularFields(softAssert, location, checkSpeed);
144 public static void checkLocationRegularFields(SoftAssert softAssert, Location location,
151 + "must have altitudes.", location.hasAltitude());
152 if(location.hasAltitude()) {
154 location.getAltitude() >= -500);
156 location.getAltitude() < 6000);
161 if (location.hasSpeed() && location.getSpeed() > MINIMUM_SPEED_FOR_BEARING) {
163 + "the LocationManager must have bearings.", location.hasBearing());
164 if(location.hasBearing()) {
166 location.getBearing() >= 0 && location.getBearing() <= 360);
171 location.getElapsedRealtimeNanos() > 0);
173 assertEquals("gps", location.getProvider());
174 assertTrue(location.getTime() > 0);
177 location.getLongitude() >= -180 && location.getLongitude() <= 180);
180 location.getLatitude() >= -90 && location.getLatitude() <= 90);
183 softAssert.assertTrue("All but the first GNSS location from LocationManager "
184 + "must have speeds.", location.hasSpeed());
189 if(location.hasSpeed()) {
191 location.getSpeed() >= 0 && location.getSpeed() <= 5);