diff options
author | wangqi <wangqi@google.com> | 2017-09-21 09:37:40 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-22 15:59:39 +0000 |
commit | 1420a22d5dc0d87f8634980b729a3511e42b6493 (patch) | |
tree | e82dd12010685713517e7b4737b999839880e843 /java/com/android/dialer/app/filterednumber/NumbersAdapter.java | |
parent | 3f4a31982fc815b1620671f16f7d45a8d2c07988 (diff) |
Better handling country iso when getting geo location of phone number.
1. Use existing country iso info instead of guessing current country iso from sim and locale for blocked number.
2. Use country iso of current sim instead of default sim for incall location info. This fixes bug in multi sim device when default sim is out of service and making call with the other sim.
Bug: 65399976
Test: manual
PiperOrigin-RevId: 169554641
Change-Id: I416d7e2d6bc3c872bfec3eda4005a5a1684f0e40
Diffstat (limited to 'java/com/android/dialer/app/filterednumber/NumbersAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/filterednumber/NumbersAdapter.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java index 938a78479..bdd6dcee8 100644 --- a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java +++ b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java @@ -72,7 +72,7 @@ public class NumbersAdapter extends SimpleCursorAdapter { info = new ContactInfo(); info.number = number; } - final CharSequence locationOrType = getNumberTypeOrLocation(info); + final CharSequence locationOrType = getNumberTypeOrLocation(info, countryIso); final String displayNumber = getDisplayNumber(info); final String displayNumberStr = mBidiFormatter.unicodeWrap(displayNumber, TextDirectionHeuristics.LTR); @@ -121,12 +121,12 @@ public class NumbersAdapter extends SimpleCursorAdapter { } } - private CharSequence getNumberTypeOrLocation(ContactInfo info) { + private CharSequence getNumberTypeOrLocation(ContactInfo info, String countryIso) { if (!TextUtils.isEmpty(info.name)) { return ContactsContract.CommonDataKinds.Phone.getTypeLabel( mContext.getResources(), info.type, info.label); } else { - return PhoneNumberHelper.getGeoDescription(mContext, info.number); + return PhoneNumberHelper.getGeoDescription(mContext, info.number, countryIso); } } |