diff options
Diffstat (limited to 'java')
4 files changed, 18 insertions, 9 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 653b51aa5..15b04eaaf 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -52,6 +52,7 @@ import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.multimedia.MultimediaData; import com.android.dialer.oem.MotorolaUtils; +import com.android.dialer.phonenumberutil.PhoneNumberHelper; import com.android.dialer.postcall.PostCall; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.ContactInfoCache.ContactInfoCacheCallback; @@ -466,7 +467,8 @@ public class CallCardPresenter getCallStateIcon(), getGatewayNumber(), shouldShowCallSubject(mPrimary) ? mPrimary.getCallSubject() : null, - mPrimary.getCallbackNumber(), + PhoneNumberHelper.formatNumber( + mPrimary.getCallbackNumber(), mPrimary.getSimCountryIso()), mPrimary.hasProperty(Details.PROPERTY_WIFI), mPrimary.isConferenceCall() && !mPrimary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE), diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index a9bad5b58..4f31dadf4 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1182,6 +1182,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return callbackNumber; } + public String getSimCountryIso() { + String simCountryIso = + TelephonyManagerCompat.getTelephonyManagerForPhoneAccountHandle( + mContext, getAccountHandle()) + .getSimCountryIso(); + if (!TextUtils.isEmpty(simCountryIso)) { + simCountryIso = simCountryIso.toUpperCase(Locale.US); + } + return simCountryIso; + } + @Override public void onVideoTechStateChanged() { update(); diff --git a/java/com/android/incallui/contactgrid/BottomRow.java b/java/com/android/incallui/contactgrid/BottomRow.java index 6068cc0e5..91f08ef3e 100644 --- a/java/com/android/incallui/contactgrid/BottomRow.java +++ b/java/com/android/incallui/contactgrid/BottomRow.java @@ -103,10 +103,7 @@ public class BottomRow { } } else if (!TextUtils.isEmpty(state.callbackNumber)) { // This is used for carriers like Project Fi to show the callback number for emergency calls. - label = - context.getString( - R.string.contact_grid_callback_number, - PhoneNumberUtils.formatNumber(state.callbackNumber)); + label = context.getString(R.string.contact_grid_callback_number, state.callbackNumber); isTimerVisible = false; } else { label = getLabelForPhoneNumber(primaryInfo); diff --git a/java/com/android/incallui/contactgrid/res/values/strings.xml b/java/com/android/incallui/contactgrid/res/values/strings.xml index 63037dc31..eba4abf30 100644 --- a/java/com/android/incallui/contactgrid/res/values/strings.xml +++ b/java/com/android/incallui/contactgrid/res/values/strings.xml @@ -80,8 +80,7 @@ <!-- Displayed in the answer call screen for incoming spam calls. --> <string name="contact_grid_incoming_suspected_spam">Suspected spam caller</string> - <!-- In-call screen: string shown to the user when their outgoing number is different than the - number reported by TelephonyManager#getLine1Number(). This is used for carriers like - Project Fi so that users can give their number to emergency responders. --> - <string name="contact_grid_callback_number">Callback number: <xliff:g id="dark_number">%1$s</xliff:g></string> + <!-- In-call screen: phone number of the device shown to the users so that users can give their + number to emergency responders. --> + <string name="contact_grid_callback_number">This phone\'s number: <xliff:g id="light_number">%1$s</xliff:g></string> </resources> |