Fix UI on outgoing call view

-If an call is active and we call an other contact and he decline, view
wasn't finish
This commit is contained in:
Erwan Croze 2017-07-19 16:37:32 +02:00
parent 294c4c3e21
commit c058db7ff7

View file

@ -106,19 +106,25 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
// Convert LinphoneCore message for internalization // Convert LinphoneCore message for internalization
if (call.getErrorInfo().getReason() == Reason.Declined) { if (call.getErrorInfo().getReason() == Reason.Declined) {
displayCustomToast(getString(R.string.error_call_declined), Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_call_declined), Toast.LENGTH_SHORT);
decline();
} else if (call.getErrorInfo().getReason() == Reason.NotFound) { } else if (call.getErrorInfo().getReason() == Reason.NotFound) {
displayCustomToast(getString(R.string.error_user_not_found), Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_user_not_found), Toast.LENGTH_SHORT);
decline();
} else if (call.getErrorInfo().getReason() == Reason.Media) { } else if (call.getErrorInfo().getReason() == Reason.Media) {
displayCustomToast(getString(R.string.error_incompatible_media), Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_incompatible_media), Toast.LENGTH_SHORT);
decline();
} else if (call.getErrorInfo().getReason() == Reason.Busy) { } else if (call.getErrorInfo().getReason() == Reason.Busy) {
displayCustomToast(getString(R.string.error_user_busy), Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_user_busy), Toast.LENGTH_SHORT);
decline();
} else if (message != null) { } else if (message != null) {
displayCustomToast(getString(R.string.error_unknown) + " - " + message, Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_unknown) + " - " + message, Toast.LENGTH_SHORT);
decline();
} }
}else if (state == State.CallEnd) { }else if (state == State.CallEnd) {
// Convert LinphoneCore message for internalization // Convert LinphoneCore message for internalization
if (call.getErrorInfo().getReason() == Reason.Declined) { if (call.getErrorInfo().getReason() == Reason.Declined) {
displayCustomToast(getString(R.string.error_call_declined), Toast.LENGTH_SHORT); displayCustomToast(getString(R.string.error_call_declined), Toast.LENGTH_SHORT);
decline();
} }
} }