diff options
author | Andrew Lee <anwlee@google.com> | 2015-04-15 02:04:51 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-04-15 11:15:18 -0700 |
commit | 1838e77845e2ba822bc7f510515b50cf00ddc2a4 (patch) | |
tree | df2488b751a7786620036a32a9733f79e8f05dff /src/com/android/incallui/CallCardFragment.java | |
parent | 1a3d05dc126773f0e0d32135f9b1018f1a4c8b5e (diff) | |
download | packages_apps_InCallUI-1838e77845e2ba822bc7f510515b50cf00ddc2a4.tar.gz packages_apps_InCallUI-1838e77845e2ba822bc7f510515b50cf00ddc2a4.tar.bz2 packages_apps_InCallUI-1838e77845e2ba822bc7f510515b50cf00ddc2a4.zip |
Show IMS Conference StatusHints in InCall.
A lot of this logic for figuring out what label should be shown seems
like it should be determined in the presenter, rather than passing
through all this information to the fragment, but it can be cleaned up
at another time.
+ minor layout tweak.
Bug: 20181703
Change-Id: I392ce7cffc8c05eb94859892e899ce7c693895aa
Diffstat (limited to 'src/com/android/incallui/CallCardFragment.java')
-rw-r--r-- | src/com/android/incallui/CallCardFragment.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java index 28f449b9..4fa9d7ec 100644 --- a/src/com/android/incallui/CallCardFragment.java +++ b/src/com/android/incallui/CallCardFragment.java @@ -489,10 +489,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr String connectionLabel, Drawable callStateIcon, String gatewayNumber, - boolean isWifi) { + boolean isWifi, + boolean isConference) { boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber); CharSequence callStateLabel = getCallStateLabelFromState(state, videoState, - sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi); + sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi, + isConference); Log.v(this, "setCallState " + callStateLabel); Log.v(this, "DisconnectCause " + disconnectCause.toString()); @@ -658,15 +660,17 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr * 3. Incoming calls will only display "Incoming via..." for accounts. * 4. Video calls, and session modification states (eg. requesting video). * 5. Incoming and active Wi-Fi calls will show label provided by hint. + * + * TODO: Move this to the CallCardPresenter. */ private CharSequence getCallStateLabelFromState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String label, - boolean isGatewayCall, boolean isWifi) { + boolean isGatewayCall, boolean isWifi, boolean isConference) { final Context context = getView().getContext(); CharSequence callStateLabel = null; // Label to display as part of the call banner - boolean isSpecialCall = label != null; - boolean isAccount = isSpecialCall && !isGatewayCall; + boolean hasSuggestedLabel = label != null; + boolean isAccount = hasSuggestedLabel && !isGatewayCall; switch (state) { case Call.State.IDLE: @@ -675,7 +679,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr case Call.State.ACTIVE: // We normally don't show a "call state label" at all in this state // (but we can use the call state label to display the provider name). - if (isAccount || isWifi) { + if ((isAccount || isWifi || isConference) && hasSuggestedLabel) { callStateLabel = label; } else if (sessionModificationState == Call.SessionModificationState.REQUEST_FAILED) { @@ -692,7 +696,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr break; case Call.State.CONNECTING: case Call.State.DIALING: - if (isSpecialCall && !isWifi) { + if (hasSuggestedLabel && !isWifi) { callStateLabel = context.getString(R.string.calling_via_template, label); } else { callStateLabel = context.getString(R.string.card_title_dialing); @@ -703,7 +707,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr break; case Call.State.INCOMING: case Call.State.CALL_WAITING: - if (isWifi) { + if (isWifi && hasSuggestedLabel) { callStateLabel = label; } else if (isAccount) { callStateLabel = context.getString(R.string.incoming_via_template, label); |