summaryrefslogtreecommitdiffstats
path: root/services/tests
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2011-12-09 17:43:35 -0800
committerMakoto Onuki <omakoto@google.com>2011-12-09 17:55:18 -0800
commitf9165b7e43885a3bf8c2b14788d0600642493d58 (patch)
tree55722a390454b21bd803a9a7137097cccac1eeac /services/tests
parentc2fc52dc9ce8728bcd1c2b4d82ee573fa7f5049b (diff)
downloadframeworks_base-f9165b7e43885a3bf8c2b14788d0600642493d58.zip
frameworks_base-f9165b7e43885a3bf8c2b14788d0600642493d58.tar.gz
frameworks_base-f9165b7e43885a3bf8c2b14788d0600642493d58.tar.bz2
MCC detection fixes for CountryDetector
- Don't get and cache phone tpe at the initialization time. At this point TelephonyManager is probably not ready yet. - Refresh MCC whenever we get the service state changed callback, even when the state hasn't actually changed, in order to make sure we get refresh country properly when MCC changes. - Also remove the initialization of mPhoneStateListener, which prevented us from registering phone state listener properly. - Also fix tests which were already failing. Bug 5670680 Change-Id: Id45abeba1b1e843053ac2c946861b439ca568de4
Diffstat (limited to 'services/tests')
-rwxr-xr-xservices/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java b/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java
index 60677df..5f5d668 100755
--- a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java
@@ -213,7 +213,7 @@ public class LocationBasedCountryDetectorTest extends AndroidTestCase {
// QueryThread should be set to NULL
assertNull(detector.getQueryThread());
assertTrue(countryListener.notified());
- assertEquals(countryListener.getCountry(), country);
+ assertEquals("us", countryListener.getCountry().toLowerCase());
}
public void testFindingCountryCancelled() {
@@ -238,7 +238,7 @@ public class LocationBasedCountryDetectorTest extends AndroidTestCase {
// QueryThread should be set to NULL
assertNull(detector.getQueryThread());
assertTrue(countryListener.notified());
- assertEquals(countryListener.getCountry(), country);
+ assertEquals("us", countryListener.getCountry().toLowerCase());
}
public void testFindingLocationCancelled() {
@@ -339,7 +339,7 @@ public class LocationBasedCountryDetectorTest extends AndroidTestCase {
assertNull(detector.getQueryThread());
// CountryListener should be notified
assertTrue(countryListener.notified());
- assertEquals(countryListener.getCountry(), country);
+ assertEquals("us", countryListener.getCountry().toLowerCase());
}
private void waitForTimerReset(TestCountryDetector detector) {