Loading InCallUI/res/layout/primary_call_info.xml +2 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,8 @@ <ImageView android:id="@+id/callStateIcon" android:layout_width="16dp" android:layout_height="match_parent" android:layout_marginEnd="8dp" android:layout_marginStart="6dp" android:layout_marginEnd="10dp" android:tint="@color/incall_accent_color" android:alpha="0.0" android:scaleType="center" Loading InCallUI/src/com/android/incallui/CallCardFragment.java +12 −8 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading @@ -665,15 +667,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: Loading @@ -682,7 +686,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) { Loading @@ -702,7 +706,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); Loading @@ -713,7 +717,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); Loading InCallUI/src/com/android/incallui/CallCardPresenter.java +6 −3 Original line number Diff line number Diff line Loading @@ -256,7 +256,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> null, null, null, false /* isWifi */); false /* isWifi */, false /* isConference */); getUi().showHdAudioIndicator(false); } Loading Loading @@ -303,7 +304,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getConnectionLabel(), getCallStateIcon(), getGatewayNumber(), primaryCallCan(Details.CAPABILITY_WIFI)); primaryCallCan(Details.CAPABILITY_WIFI), mPrimary.isConferenceCall()); boolean showHdAudioIndicator = isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO); Loading Loading @@ -780,7 +782,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> String providerLabel, boolean isConference, boolean isVideoCall); void setCallState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, Drawable connectionIcon, String gatewayNumber, boolean isWifi); Drawable connectionIcon, String gatewayNumber, boolean isWifi, boolean isConference); void setPrimaryCallElapsedTime(boolean show, long duration); void setPrimaryName(String name, boolean nameIsNumber); void setPrimaryImage(Drawable image); Loading Loading
InCallUI/res/layout/primary_call_info.xml +2 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,8 @@ <ImageView android:id="@+id/callStateIcon" android:layout_width="16dp" android:layout_height="match_parent" android:layout_marginEnd="8dp" android:layout_marginStart="6dp" android:layout_marginEnd="10dp" android:tint="@color/incall_accent_color" android:alpha="0.0" android:scaleType="center" Loading
InCallUI/src/com/android/incallui/CallCardFragment.java +12 −8 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading @@ -665,15 +667,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: Loading @@ -682,7 +686,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) { Loading @@ -702,7 +706,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); Loading @@ -713,7 +717,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); Loading
InCallUI/src/com/android/incallui/CallCardPresenter.java +6 −3 Original line number Diff line number Diff line Loading @@ -256,7 +256,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> null, null, null, false /* isWifi */); false /* isWifi */, false /* isConference */); getUi().showHdAudioIndicator(false); } Loading Loading @@ -303,7 +304,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getConnectionLabel(), getCallStateIcon(), getGatewayNumber(), primaryCallCan(Details.CAPABILITY_WIFI)); primaryCallCan(Details.CAPABILITY_WIFI), mPrimary.isConferenceCall()); boolean showHdAudioIndicator = isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO); Loading Loading @@ -780,7 +782,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> String providerLabel, boolean isConference, boolean isVideoCall); void setCallState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, Drawable connectionIcon, String gatewayNumber, boolean isWifi); Drawable connectionIcon, String gatewayNumber, boolean isWifi, boolean isConference); void setPrimaryCallElapsedTime(boolean show, long duration); void setPrimaryName(String name, boolean nameIsNumber); void setPrimaryImage(Drawable image); Loading