diff options
author | Victor Chang <vichang@google.com> | 2016-01-14 17:30:41 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2016-01-14 18:13:12 +0000 |
commit | 7f07f9f6f1e209359cf069b1fa4b0dfc0b371f64 (patch) | |
tree | 890f635a98b3fc4bf9f3121fd8a0840eb5b3d09a /InCallUI/src/com/android/incallui | |
parent | f9aea95a921900b552bc808513f7c42c15e16f6c (diff) |
Add work description into call state in InCallUI
Only description of incoming call and call ended are affected
BUG=26082618
Change-Id: Ic511aac339b02db4453e695bfc92ccad47a97c83
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 11 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 11 |
2 files changed, 15 insertions, 7 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index efd4818a4..1a9f283b1 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -714,11 +714,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr Drawable callStateIcon, String gatewayNumber, boolean isWifi, - boolean isConference) { + boolean isConference, + boolean isWorkCall) { boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber); CallStateLabel callStateLabel = getCallStateLabelFromState(state, videoState, sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi, - isConference); + isConference, isWorkCall); Log.v(this, "setCallState " + callStateLabel.getCallStateLabel()); Log.v(this, "AutoDismiss " + callStateLabel.isAutoDismissing()); @@ -1010,7 +1011,7 @@ 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 isWorkCall) { final Context context = getView().getContext(); CharSequence callStateLabel = null; // Label to display as part of the call banner @@ -1068,7 +1069,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } else if (VideoUtils.isVideoCall(videoState)) { callStateLabel = context.getString(R.string.notification_incoming_video_call); } else { - callStateLabel = context.getString(R.string.card_title_incoming_call); + callStateLabel = + context.getString(isWorkCall ? R.string.card_title_incoming_work_call + : R.string.card_title_incoming_call); } break; case Call.State.DISCONNECTING: diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index fed229d76..f54c633b3 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -318,7 +318,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> null, null, false /* isWifi */, - false /* isConference */); + false /* isConference */, + false /* isWorkCall */); getUi().showHdAudioIndicator(false); } @@ -410,6 +411,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private void updatePrimaryCallState() { if (getUi() != null && mPrimary != null) { + boolean isWorkCall = mPrimary.hasProperty(PROPERTY_WORK_CALL) + || (mPrimaryContactInfo == null ? false + : mPrimaryContactInfo.userType == ContactsUtils.USER_TYPE_WORK); getUi().setCallState( mPrimary.getState(), mPrimary.getVideoState(), @@ -419,7 +423,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getCallStateIcon(), getGatewayNumber(), mPrimary.hasProperty(Details.PROPERTY_WIFI), - mPrimary.isConferenceCall()); + mPrimary.isConferenceCall(), + isWorkCall); maybeShowHdAudioIcon(); setCallbackNumber(); @@ -1108,7 +1113,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> void setCallState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, Drawable connectionIcon, String gatewayNumber, boolean isWifi, - boolean isConference); + boolean isConference, boolean isWorkCall); void setPrimaryCallElapsedTime(boolean show, long duration); void setPrimaryName(String name, boolean nameIsNumber); void setPrimaryImage(Drawable image, boolean isVisible); |