diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index d7e39d8c9..3a4c46a60 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -248,14 +248,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getUi().showHdAudioIndicator(false); } - // Hide/show the contact photo based on the video state. - // If the primary call is a video call on hold, still show the contact photo. - // If the primary call is an active video call, hide the contact photo. - if (mPrimary != null) { - getUi().setPhotoVisible(!(mPrimary.isVideoCall(mContext) && - callState != Call.State.ONHOLD)); - } - maybeShowManageConferenceCallButton(); final boolean enableEndCallButton = Call.State.isConnectingOrConnected(callState) && @@ -334,9 +326,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(); @@ -350,12 +348,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() { @@ -746,7 +745,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> void setPrimaryLabel(String label); void setEndCallButtonEnabled(boolean enabled, boolean animate); void setCallbackNumber(String number, boolean isEmergencyCalls); - void setPhotoVisible(boolean isVisible); void setProgressSpinnerVisible(boolean visible); void showHdAudioIndicator(boolean visible); void showManageConferenceCallButton(boolean visible); |