summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Brown <dab@google.com> 2011-06-23 17:12:47 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-06-23 17:12:47 -0700
commit62250fbcd15dc46fd37341f9843e87585e132f05 (patch)
tree804fea541629112a7ede960ab891072349ed478b
parentcf86dc2997825005cff81b4b253c3b63bca8ee97 (diff)
parentcec25c4e8afdc56451f7405f8605c1d67433e2ff (diff)
Merge "CallerInfo query: Turn on "geo description" lookup for unknown numbers"
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfo.java12
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java2
2 files changed, 13 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index 76b8b65291de..ab93e2a90ea9 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -526,8 +526,20 @@ public class CallerInfo {
+ countryIso);
}
+ // Temp workaround: The current libphonenumber library requires
+ // the countryIso to be uppercase (e.g. "US") but the
+ // detector.detectCountry().getCountryIso() call currently returns
+ // "us". Passing "us" to util.parse() will just result in a
+ // NumberParseException.
+ // So force the countryIso to uppercase for now.
+ // TODO: remove this once getCountryIso() is fixed to always
+ // return uppercase.
+ countryIso = countryIso.toUpperCase();
+
PhoneNumber pn = null;
try {
+ if (VDBG) Log.v(TAG, "parsing '" + number
+ + "' for countryIso '" + countryIso + "'...");
pn = util.parse(number, countryIso);
if (VDBG) Log.v(TAG, "- parsed number: " + pn);
} catch (NumberParseException e) {
diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
index 1bd9b0cff590..2e8a7421b4d7 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
@@ -55,7 +55,7 @@ public class CallerInfoAsyncQuery {
// PhoneNumberOfflineGeocoder to look up a "geo description"?
// (TODO: This could become a flag in config.xml if it ever needs to be
// configured on a per-product basis.)
- private static final boolean ENABLE_UNKNOWN_NUMBER_GEO_DESCRIPTION = false;
+ private static final boolean ENABLE_UNKNOWN_NUMBER_GEO_DESCRIPTION = true;
/**
* Interface for a CallerInfoAsyncQueryHandler result return.