diff options
author | mengsun <msun@codeaurora.org> | 2014-01-10 17:24:38 +0800 |
---|---|---|
committer | emancebo <emancebo@cyngn.com> | 2014-09-02 15:42:29 -0700 |
commit | 79451465d937b5a6e4772d465474999a268a1e73 (patch) | |
tree | e00692cf245ae3018221f505eec3edea2ec6d2d6 /src | |
parent | 46ad643c0bfbd3c7aab670e405ce2a2280539a91 (diff) | |
download | packages_apps_InCallUI-79451465d937b5a6e4772d465474999a268a1e73.tar.gz packages_apps_InCallUI-79451465d937b5a6e4772d465474999a268a1e73.tar.bz2 packages_apps_InCallUI-79451465d937b5a6e4772d465474999a268a1e73.zip |
Enable home location feature
Check whether home location provider exist and if yes, query the location.
Change-Id: I8c08613a2f730d3d2ca3c8078bf87f1226218785
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/incallui/CallerInfo.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/incallui/CallerInfo.java b/src/com/android/incallui/CallerInfo.java index e3d2e632..187c8b71 100644 --- a/src/com/android/incallui/CallerInfo.java +++ b/src/com/android/incallui/CallerInfo.java @@ -23,6 +23,7 @@ import android.graphics.drawable.Drawable; import android.location.Country; import android.location.CountryDetector; import android.net.Uri; +import android.os.Bundle; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; import android.provider.ContactsContract.PhoneLookup; @@ -517,7 +518,22 @@ public class CallerInfo { */ public void updateGeoDescription(Context context, String fallbackNumber) { String number = TextUtils.isEmpty(phoneNumber) ? fallbackNumber : phoneNumber; - geoDescription = getGeoDescription(context, number); + Uri CONTENT_URI = Uri.parse("content://geocoded_location/location"); + String METHOD_QUERY = "getLocation"; + String RESULT_ADDRESS = "location"; + String address = null; + if (context.getContentResolver().acquireProvider(CONTENT_URI) != null) { + Bundle result = context.getContentResolver().call(CONTENT_URI, METHOD_QUERY, number, + null); + if (result != null) { + address = result.getString(RESULT_ADDRESS); + } + } + if (address != null) { + geoDescription = address; + } else { + geoDescription = getGeoDescription(context, number); + } } /** |