diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-10-07 17:42:41 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-10-07 17:42:41 +0000 |
commit | 2ee8713ab03d6984b8b07b2f3b3b2c043998b512 (patch) | |
tree | bc7ec134b9af834c396eaac8a778d9df4c10e548 | |
parent | 6bcfb8e7585999a821f68dd14fe5e3994634ca58 (diff) | |
parent | e017ddcd2c46c3e0676ddb26e272df50a4918da1 (diff) | |
download | cts-2ee8713ab03d6984b8b07b2f3b3b2c043998b512.tar.gz |
Merge "Skips awaitStart(), awaitTtff(), awaitStop() in checkGnssChange for automotive" into android12L-tests-dev
-rw-r--r-- | tests/location/location_gnss/src/android/location/cts/gnss/GnssAntennaInfoTest.java | 17 | ||||
-rw-r--r-- | tests/location/location_gnss/src/android/location/cts/gnss/GnssStatusTest.java | 15 |
2 files changed, 24 insertions, 8 deletions
diff --git a/tests/location/location_gnss/src/android/location/cts/gnss/GnssAntennaInfoTest.java b/tests/location/location_gnss/src/android/location/cts/gnss/GnssAntennaInfoTest.java index b3d31415b35..0780a07bd5b 100644 --- a/tests/location/location_gnss/src/android/location/cts/gnss/GnssAntennaInfoTest.java +++ b/tests/location/location_gnss/src/android/location/cts/gnss/GnssAntennaInfoTest.java @@ -37,10 +37,11 @@ public class GnssAntennaInfoTest { private static final double CARRIER_FREQ_TOLERANCE_HZ = 10 * 1e6; private TestLocationManager mTestLocationManager; + private Context context; @Before public void setUp() throws Exception { - Context context = ApplicationProvider.getApplicationContext(); + context = ApplicationProvider.getApplicationContext(); mTestLocationManager = new TestLocationManager(context); } @@ -97,11 +98,19 @@ public class GnssAntennaInfoTest { LocationManager.GPS_PROVIDER, /* minTimeMs= */0, /* minDistanceM= */ 0, listener, Looper.getMainLooper()); - boolean success = testGnssStatusCallback.awaitStart(); + boolean isAutomotiveDevice = TestMeasurementUtil.isAutomotiveDevice(context); + boolean success = true; + if(!isAutomotiveDevice){ + success = testGnssStatusCallback.awaitStart(); + } success = success ? testGnssStatusCallback.awaitStatus() : false; - success = success ? testGnssStatusCallback.awaitTtff() : false; + if(!isAutomotiveDevice){ + success = success ? testGnssStatusCallback.awaitTtff() : false; + } mTestLocationManager.getLocationManager().removeUpdates(listener); - success = success ? testGnssStatusCallback.awaitStop() : false; + if(!isAutomotiveDevice){ + success = success ? testGnssStatusCallback.awaitStop() : false; + } mTestLocationManager.unregisterGnssStatusCallback(testGnssStatusCallback); assertWithMessage( diff --git a/tests/location/location_gnss/src/android/location/cts/gnss/GnssStatusTest.java b/tests/location/location_gnss/src/android/location/cts/gnss/GnssStatusTest.java index c23b272536d..d9ea4d82d8a 100644 --- a/tests/location/location_gnss/src/android/location/cts/gnss/GnssStatusTest.java +++ b/tests/location/location_gnss/src/android/location/cts/gnss/GnssStatusTest.java @@ -43,7 +43,6 @@ public class GnssStatusTest extends GnssTestCase { // active location requests, allowing this test to receive all necessary Gnss callbacks. List<String> courseLocationPackages = TestUtils.revokePermissions(ACCESS_COARSE_LOCATION); List<String> fineLocationPackages = TestUtils.revokePermissions(ACCESS_FINE_LOCATION); - try { // Register Gps Status Listener. TestGnssStatusCallback testGnssStatusCallback = @@ -63,11 +62,19 @@ public class GnssStatusTest extends GnssTestCase { TestLocationListener locationListener = new TestLocationListener(LOCATION_TO_COLLECT_COUNT); mTestLocationManager.requestLocationUpdates(locationListener); - boolean success = testGnssStatusCallback.awaitStart(); + boolean isAutomotiveDevice = TestMeasurementUtil.isAutomotiveDevice(getContext()); + boolean success = true; + if(!isAutomotiveDevice){ + success = testGnssStatusCallback.awaitStart(); + } success = success ? testGnssStatusCallback.awaitStatus() : false; - success = success ? testGnssStatusCallback.awaitTtff() : false; + if(!isAutomotiveDevice){ + success = success ? testGnssStatusCallback.awaitTtff() : false; + } mTestLocationManager.removeLocationUpdates(locationListener); - success = success ? testGnssStatusCallback.awaitStop() : false; + if(!isAutomotiveDevice){ + success = success ? testGnssStatusCallback.awaitStop() : false; + } mTestLocationManager.unregisterGnssStatusCallback(testGnssStatusCallback); SoftAssert softAssert = new SoftAssert(TAG); |