Loading telephony/java/com/android/internal/telephony/CallerInfo.java +18 −11 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.location.Country; import android.location.CountryDetector; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -561,12 +562,18 @@ public class CallerInfo { * is in. */ private static String getCurrentCountryIso(Context context, Locale locale) { String countryIso; String countryIso = null; CountryDetector detector = (CountryDetector) context.getSystemService( Context.COUNTRY_DETECTOR); if (detector != null) { countryIso = detector.detectCountry().getCountryIso(); Country country = detector.detectCountry(); if (country != null) { countryIso = country.getCountryIso(); } else { Rlog.e(TAG, "CountryDetector.detectCountry() returned null."); } } if (countryIso == null) { countryIso = locale.getCountry(); Rlog.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); Loading Loading
telephony/java/com/android/internal/telephony/CallerInfo.java +18 −11 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.location.Country; import android.location.CountryDetector; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -561,12 +562,18 @@ public class CallerInfo { * is in. */ private static String getCurrentCountryIso(Context context, Locale locale) { String countryIso; String countryIso = null; CountryDetector detector = (CountryDetector) context.getSystemService( Context.COUNTRY_DETECTOR); if (detector != null) { countryIso = detector.detectCountry().getCountryIso(); Country country = detector.detectCountry(); if (country != null) { countryIso = country.getCountryIso(); } else { Rlog.e(TAG, "CountryDetector.detectCountry() returned null."); } } if (countryIso == null) { countryIso = locale.getCountry(); Rlog.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); Loading