diff options
Diffstat (limited to 'src/com/android/incallui/CallCardFragment.java')
-rw-r--r-- | src/com/android/incallui/CallCardFragment.java | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java index 0b6fefda..57372f72 100644 --- a/src/com/android/incallui/CallCardFragment.java +++ b/src/com/android/incallui/CallCardFragment.java @@ -509,7 +509,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr */ @Override public void setPrimary(String number, String name, boolean nameIsNumber, String label, - Drawable photo, boolean isSipCall, boolean isContactPhotoShown) { + Drawable photo, boolean isSipCall, boolean isForwarded, boolean isContactPhotoShown) { Log.d(this, "Setting primary call"); // set the name field. setPrimaryName(name, nameIsNumber); @@ -527,7 +527,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr // Set the label (Mobile, Work, etc) setPrimaryLabel(label); - showInternetCallLabel(isSipCall); + showCallTypeLabel(isSipCall, isForwarded); setDrawableToImageView(mPhoto, photo, isContactPhotoShown); } @@ -652,11 +652,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr Drawable callStateIcon, String gatewayNumber, boolean isWifi, - boolean isConference) { + boolean isConference, + boolean isWaitingForRemoteSide) { boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber); CallStateLabel callStateLabel = getCallStateLabelFromState(state, videoState, sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi, - isConference); + isConference, isWaitingForRemoteSide); Log.v(this, "setCallState " + callStateLabel.getCallStateLabel()); Log.v(this, "AutoDismiss " + callStateLabel.isAutoDismissing()); @@ -824,12 +825,13 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr return mIsAnimating; } - private void showInternetCallLabel(boolean show) { - if (show) { - final String label = getView().getContext().getString( - R.string.incall_call_type_label_sip); + private void showCallTypeLabel(boolean isSipCall, boolean isForwarded) { + if (isSipCall) { + mCallTypeLabel.setVisibility(View.VISIBLE); + mCallTypeLabel.setText(R.string.incall_call_type_label_sip); + } else if (isForwarded) { mCallTypeLabel.setVisibility(View.VISIBLE); - mCallTypeLabel.setText(label); + mCallTypeLabel.setText(R.string.incall_call_type_label_forwarded); } else { mCallTypeLabel.setVisibility(View.GONE); } @@ -894,7 +896,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr */ private CallStateLabel getCallStateLabelFromState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String label, - boolean isGatewayCall, boolean isWifi, boolean isConference) { + boolean isGatewayCall, boolean isWifi, boolean isConference, + boolean isWaitingForRemoteSide) { final Context context = getView().getContext(); CharSequence callStateLabel = null; // Label to display as part of the call banner @@ -925,11 +928,17 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr callStateLabel = context.getString(R.string.card_title_video_call_requesting); } else if (CallUtils.isVideoCall(videoState)) { callStateLabel = context.getString(R.string.card_title_video_call); + } else if (isWaitingForRemoteSide) { + callStateLabel = context.getString(R.string.card_title_waiting_call); } if ((isAccount || isWifi || isConference) && hasSuggestedLabel) { - label += (callStateLabel != null) ? (" " + callStateLabel) : ""; - callStateLabel = label; + if (callStateLabel != null) { + callStateLabel = context.getString(R.string.card_title_active_via_template, + callStateLabel, label); + } else { + callStateLabel = label; + } } break; case Call.State.ONHOLD: @@ -938,7 +947,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr case Call.State.CONNECTING: case Call.State.DIALING: if (hasSuggestedLabel && !isWifi) { - callStateLabel = context.getString(R.string.calling_via_template, label); + int resId = isWaitingForRemoteSide + ? R.string.calling_via_waiting_template + : R.string.calling_via_template; + callStateLabel = context.getString(resId, label); + } else if (isWaitingForRemoteSide) { + callStateLabel = context.getString(R.string.card_title_dialing_waiting); } else { callStateLabel = context.getString(R.string.card_title_dialing); } |