mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fix lime2 bug
This commit is contained in:
parent
8491aad634
commit
c07b81aff4
6 changed files with 45 additions and 23 deletions
|
|
@ -60,6 +60,7 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.receivers.BluetoothManager;
|
||||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.contacts.LinphoneContact;
|
||||
|
|
@ -97,6 +98,8 @@ import java.util.List;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class CallActivity extends LinphoneGenericActivity implements OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback {
|
||||
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 4000;
|
||||
private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000;
|
||||
|
|
@ -1364,15 +1367,16 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
//background.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.getAuthenticationTokenVerified()) || mediaEncryption == MediaEncryption.DTLS) {
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), call.getRemoteAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
encryption.setImageResource(R.drawable.security_button_default);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure2);
|
||||
} else if (mediaEncryption == MediaEncryption.ZRTP && !call.getAuthenticationTokenVerified()) {
|
||||
encryption.setImageResource(R.drawable.security_button1_default);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
encryption.setImageResource(R.drawable.security_button1_over);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_unsecure);
|
||||
} else {
|
||||
encryption.setImageResource(R.drawable.security_button1_default);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
}
|
||||
|
||||
if (mediaEncryption == MediaEncryption.ZRTP) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import org.linphone.core.ChatRoomSecurityLevel;
|
|||
import org.linphone.core.EventLog;
|
||||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.ui.ListSelectionAdapter;
|
||||
import org.linphone.ui.ListSelectionHelper;
|
||||
|
||||
|
|
@ -57,6 +58,7 @@ import java.util.Comparator;
|
|||
import java.util.List;
|
||||
|
||||
import static android.text.format.DateUtils.isToday;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
import static org.linphone.LinphoneUtils.hasContentFileSharing;
|
||||
|
||||
public class ChatRoomsAdapter extends ListSelectionAdapter {
|
||||
|
|
@ -264,15 +266,22 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
} else if (level == ChatRoomSecurityLevel.Encrypted) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_small_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact != null && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contactAddress.asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact != null && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ import org.linphone.contacts.ContactsUpdatedListener;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.Reason;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.fragments.FragmentsAvailable;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.ListSelectionHelper;
|
||||
|
|
@ -87,6 +88,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import static android.content.Context.INPUT_METHOD_SERVICE;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
import static org.linphone.fragments.FragmentsAvailable.CHAT;
|
||||
|
||||
public class GroupChatFragment extends Fragment implements ChatRoomListener, ContactsUpdatedListener, ListSelectionHelper.DeleteListener {
|
||||
|
|
@ -542,23 +544,30 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
|||
} else {
|
||||
mRoomLabel.setText(mParticipants.get(0).getFullName());
|
||||
}
|
||||
if (level == ChatRoomSecurityLevel.ClearText) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_unregistered);
|
||||
if (level == ChatRoomSecurityLevel.Unsafe) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_unsecure);
|
||||
} else if (level == ChatRoomSecurityLevel.Encrypted) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_secure1);
|
||||
} else if (level == ChatRoomSecurityLevel.Safe) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_secure2);
|
||||
} else {
|
||||
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(mChatRoom.getParticipants()[0].getAddress());
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), mRemoteParticipantAddress.asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(mChatRoom.getParticipants()[0].getAddress());
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
avatarTop.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit eff062756d4e0eeba1fb76b61bce013478326f88
|
||||
Subproject commit c9979fe3766f7961207a2a792fa409da4ddf5dd1
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 867e55f4e0325836a16b7a3e474d03bf1a7a73fe
|
||||
Subproject commit a251d7368a3ffe0d11b9f6d8abd52128af72db0d
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 366f1a596c38f85433092d2cdc50beeb084fd569
|
||||
Subproject commit 2babd0e32f9d978eaa0efad67154883fa70c540d
|
||||
Loading…
Add table
Reference in a new issue