summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorDavid Brown <dab@google.com>2011-06-20 12:53:12 -0700
committerDavid Brown <dab@google.com>2011-06-20 16:24:19 -0700
commit2ef46c65877a7188868cec440fbe93086e011f5b (patch)
tree72bd353d5334230451f4e7871bef1a01de3018cd /telephony
parentb2af97e9a11119a257289cb8c539b5de79093052 (diff)
downloadframeworks_base-2ef46c65877a7188868cec440fbe93086e011f5b.zip
frameworks_base-2ef46c65877a7188868cec440fbe93086e011f5b.tar.gz
frameworks_base-2ef46c65877a7188868cec440fbe93086e011f5b.tar.bz2
Use a static flag to enable/disable CallerInfo "geoDescription" lookup
...and disable the lookup for now, since we don't have the latest PhoneNumberOfflineGeocoder (from the libphonenumber library) integrated into our tree yet. Bug: 4595580 Change-Id: I7391cbf1558b5a23eebfff6c4ad1f6363213c9a3
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java41
1 files changed, 25 insertions, 16 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
index bbd4232..1bd9b0c 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
@@ -51,6 +51,12 @@ public class CallerInfoAsyncQuery {
private CallerInfoAsyncQueryHandler mHandler;
+ // If the CallerInfo query finds no contacts, should we use the
+ // 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;
+
/**
* Interface for a CallerInfoAsyncQueryHandler result return.
*/
@@ -242,22 +248,25 @@ public class CallerInfoAsyncQuery {
}
// Final step: look up the geocoded description.
- //
- // For now, do this only if we *don't* have a valid name (i.e. if
- // no contacts matched the phone number of the incoming call),
- // since that's the only case where the incoming-call UI cares
- // about this field.
- // (TODO: But if we ever want the UI to show the geoDescription
- // even when we *do* match a contact, we'll need to either call
- // updateGeoDescription() unconditionally here, or possibly add a
- // new parameter to CallerInfoAsyncQuery.startQuery() to force
- // the geoDescription field to be populated.)
- if (TextUtils.isEmpty(mCallerInfo.name)) {
- // Actually when no contacts match the incoming phone number,
- // the CallerInfo object is totally blank here (i.e. no name
- // *or* phoneNumber). So we need to pass in cw.number as
- // a fallback number.
- mCallerInfo.updateGeoDescription(mQueryContext, cw.number);
+ if (ENABLE_UNKNOWN_NUMBER_GEO_DESCRIPTION) {
+ // Note we do this only if we *don't* have a valid name (i.e. if
+ // no contacts matched the phone number of the incoming call),
+ // since that's the only case where the incoming-call UI cares
+ // about this field.
+ //
+ // (TODO: But if we ever want the UI to show the geoDescription
+ // even when we *do* match a contact, we'll need to either call
+ // updateGeoDescription() unconditionally here, or possibly add a
+ // new parameter to CallerInfoAsyncQuery.startQuery() to force
+ // the geoDescription field to be populated.)
+
+ if (TextUtils.isEmpty(mCallerInfo.name)) {
+ // Actually when no contacts match the incoming phone number,
+ // the CallerInfo object is totally blank here (i.e. no name
+ // *or* phoneNumber). So we need to pass in cw.number as
+ // a fallback number.
+ mCallerInfo.updateGeoDescription(mQueryContext, cw.number);
+ }
}
// Use the number entered by the user for display.