diff options
author | Tyler Gunn <tgunn@google.com> | 2015-03-11 09:38:03 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2015-03-11 20:16:49 +0000 |
commit | c4fac46c65d20da815b37f3d1dbe2ff748fa1f00 (patch) | |
tree | 1877635fe54da24d75a86bf3b5bacf7292ffb1e5 | |
parent | c8449402b2ed0a0b4120c00923f445926bea30f2 (diff) |
Fix emergency callback number not shown for incoming calls.
- In CallCardPresenter#setCallbackNumber() check for the case where a call
has CAPABILITY_SHOW_CALLBACK_NUMBER. Use this to trigger showing the
Emergency Callback Number (the ECM is only shown on outgoing calls if the
user has a dark number).
Bug: 18689292
Change-Id: I94391e3be3360982742ce961272b680d0eaa32a5
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 3944bf62f..0464edff3 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -335,9 +335,15 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private void setCallbackNumber() { String callbackNumber = null; + // Show the emergency callback number if either: + // 1. This is an emergency call. + // 2. The phone is in Emergency Callback Mode, which means we should show the callback + // number. boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber( getNumberFromHandle(mPrimary.getHandle())); - if (isEmergencyCall) { + boolean showCallbackNumber = mPrimary.can(Details.CAPABILITY_SHOW_CALLBACK_NUMBER); + + if (isEmergencyCall || showCallbackNumber) { callbackNumber = getSubscriptionNumber(); } else { StatusHints statusHints = mPrimary.getTelecommCall().getDetails().getStatusHints(); @@ -351,12 +357,13 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> TelecomManager mgr = InCallPresenter.getInstance().getTelecomManager(); String simNumber = mgr.getLine1Number(mPrimary.getAccountHandle()); - if (PhoneNumberUtils.compare(callbackNumber, simNumber)) { - Log.d(this, "Numbers are the same; not showing the callback number"); + if (!showCallbackNumber && PhoneNumberUtils.compare(callbackNumber, simNumber)) { + Log.d(this, "Numbers are the same (and callback number is not being forced to show);" + + " not showing the callback number"); callbackNumber = null; } - getUi().setCallbackNumber(callbackNumber, isEmergencyCall); + getUi().setCallbackNumber(callbackNumber, isEmergencyCall || showCallbackNumber); } public void updateCallTime() { |