Fix skipped incoming call fragment

This commit is contained in:
Sylvain Berfini 2012-10-10 15:19:27 +02:00
parent a33ab34bd4
commit 8d8b625768

View file

@ -1058,7 +1058,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
for (int i = 0; i < sipContactCursor.getCount(); i++) { for (int i = 0; i < sipContactCursor.getCount(); i++) {
Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i); Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i);
contact.refresh(getContentResolver()); contact.refresh(getContentResolver());
if (getResources().getBoolean(R.bool.enable_linphone_friends)) { if (!isContactPresenceDisabled) {
searchFriendAndAddToContact(contact); searchFriendAndAddToContact(contact);
} }
sipContactList.add(contact); sipContactList.add(contact);
@ -1254,10 +1254,12 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
} }
if (LinphoneManager.getLc().getCalls().length > 0) { if (LinphoneManager.getLc().getCalls().length > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getCurrentParamsCopy().getVideoEnabled()) { if (call != null && call.getState() != LinphoneCall.State.IncomingReceived) {
startVideoActivity(call); if (call.getCurrentParamsCopy().getVideoEnabled()) {
} else { startVideoActivity(call);
startIncallActivity(call); } else {
startIncallActivity(call);
}
} }
} }
} }