From ddf3b1f450279cba46d690ebd78617cc6c62d308 Mon Sep 17 00:00:00 2001 From: wangqi Date: Wed, 9 Aug 2017 12:02:35 -0700 Subject: Clean up geo location data usage from libphonenumber. This change will centralize getting geo location data for a phone number thus enable us to disable it completely by compiling it out. Bug: 64394643 Test: none PiperOrigin-RevId: 164754103 Change-Id: Ie4b526a05f8b4445ee0507683cd238659273c953 --- java/com/android/dialer/location/GeoUtil.java | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'java/com/android/dialer/location') diff --git a/java/com/android/dialer/location/GeoUtil.java b/java/com/android/dialer/location/GeoUtil.java index 1be40544d..b39256d32 100644 --- a/java/com/android/dialer/location/GeoUtil.java +++ b/java/com/android/dialer/location/GeoUtil.java @@ -17,11 +17,6 @@ package com.android.dialer.location; import android.content.Context; -import com.google.i18n.phonenumbers.NumberParseException; -import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.i18n.phonenumbers.Phonenumber; -import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; -import java.util.Locale; /** Static methods related to Geo. */ public class GeoUtil { @@ -31,17 +26,4 @@ public class GeoUtil { // The {@link CountryDetector} should never return null so this is safe to return as-is. return CountryDetector.getInstance(context).getCurrentCountryIso(); } - - public static String getGeocodedLocationFor(Context context, String phoneNumber) { - final PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder.getInstance(); - final PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); - try { - final Phonenumber.PhoneNumber structuredPhoneNumber = - phoneNumberUtil.parse(phoneNumber, getCurrentCountryIso(context)); - final Locale locale = context.getResources().getConfiguration().locale; - return geocoder.getDescriptionForNumber(structuredPhoneNumber, locale); - } catch (NumberParseException e) { - return null; - } - } } -- cgit v1.2.3