mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-20 21:18:07 +00:00
Last fix
This commit is contained in:
parent
d0383867ff
commit
8491aad634
17 changed files with 179 additions and 60 deletions
|
|
@ -1095,9 +1095,11 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
Log.e("LinphoneManager"," onGlobalStateChanged ON");
|
||||
|
||||
// TODO workaround multiple proxy
|
||||
ProxyConfig prx = lc.getProxyConfigList()[0];
|
||||
for (ProxyConfig tmp : lc.getProxyConfigList()) {
|
||||
if (prx != tmp) lc.removeProxyConfig(tmp);
|
||||
if (lc.getProxyConfigList().length > 0) {
|
||||
ProxyConfig prx = lc.getProxyConfigList()[0];
|
||||
for (ProxyConfig tmp : lc.getProxyConfigList()) {
|
||||
if (prx != tmp) lc.removeProxyConfig(tmp);
|
||||
}
|
||||
}
|
||||
//TODO
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import org.linphone.core.Factory;
|
|||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.Version;
|
||||
import org.linphone.receivers.KeepAliveReceiver;
|
||||
|
|
@ -77,6 +78,7 @@ import android.view.WindowManager;
|
|||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForChatRoom;
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
/**
|
||||
* Linphone service, reacting to Incoming calls, ...<br />
|
||||
|
|
@ -562,10 +564,13 @@ public final class LinphoneService extends Service {
|
|||
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
Uri pictureUri = contact != null ? contact.getPhotoUri() : null;
|
||||
Bitmap bm = null;
|
||||
try {
|
||||
bm = MediaStore.Images.Media.getBitmap(getContentResolver(), pictureUri);
|
||||
} catch (Exception e) {
|
||||
Bitmap bm;
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), address.asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_small_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_small_unsecure);
|
||||
} else {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_small_secure1);
|
||||
}
|
||||
String name;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ import org.linphone.core.LoggingServiceListener;
|
|||
import org.linphone.core.Participant;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
||||
|
||||
|
|
@ -847,5 +848,9 @@ public final class LinphoneUtils {
|
|||
Address proxyConfigContact = proxy.getContact();
|
||||
return proxyConfigContact.getUsername().equalsIgnoreCase(username);
|
||||
}
|
||||
|
||||
public static ZrtpPeerStatus getZrtpStatus(Core lc, String uri) {
|
||||
return (uri != null) ? lc.getZrtpStatus(uri) : ZrtpPeerStatus.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ import org.linphone.LinphoneManager;
|
|||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.R;
|
||||
import org.linphone.activities.LinphoneActivity;
|
||||
import org.linphone.core.AuthInfo;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
|
@ -396,7 +398,21 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
|
|||
}
|
||||
|
||||
private boolean storeAccount(String url) {
|
||||
|
||||
int usernameIndex = url.indexOf("username=") + "username=".length();
|
||||
int domainIndex = url.indexOf("=", usernameIndex+1);
|
||||
int ha1Index = url.indexOf("=", domainIndex+1);
|
||||
|
||||
String username = url.substring(usernameIndex, url.indexOf("&"));
|
||||
String domain = url.substring(domainIndex+1, url.indexOf("&", domainIndex+1));
|
||||
String ha1 = url.substring(ha1Index+1);
|
||||
|
||||
AuthInfo auth = Factory.instance().createAuthInfo(username, null, null, ha1, domain, domain);
|
||||
LinphoneManager.getLc().clearAllAuthInfo();
|
||||
LinphoneManager.getLc().addAuthInfo(auth);
|
||||
|
||||
LinphonePreferences.instance().setRemoteProvisioningUrl(url);
|
||||
|
||||
//TODO
|
||||
LinphoneManager.getLc().iterate();
|
||||
sleep(1000);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import org.linphone.core.CoreListenerStub;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.LinphoneSliders.LinphoneSliderTriggered;
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class CallIncomingActivity extends LinphoneGenericActivity implements LinphoneSliderTriggered {
|
||||
private static CallIncomingActivity instance;
|
||||
|
|
@ -254,17 +256,23 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contact.getFriend().getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
name.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.linphone.core.PresenceActivity;
|
|||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.Reason;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.Manifest;
|
||||
|
|
@ -59,6 +60,7 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class CallOutgoingActivity extends LinphoneGenericActivity implements OnClickListener{
|
||||
private static CallOutgoingActivity instance;
|
||||
|
|
@ -206,15 +208,22 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contact.getFriend().getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@ import org.linphone.core.Participant;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class GroupInfoAdapter extends BaseAdapter {
|
||||
private LayoutInflater mInflater;
|
||||
|
|
@ -112,15 +114,22 @@ public class GroupInfoAdapter extends BaseAdapter {
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
avatar.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), ca.getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@ import org.linphone.core.ParticipantImdnState;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class ImdnFragment extends Fragment {
|
||||
private LayoutInflater mInflater;
|
||||
|
|
@ -172,15 +174,22 @@ public class ImdnFragment extends Fragment {
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
img.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact != null && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
img.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contact.getFriend().getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
img.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
img.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && contact != null && contact.getFriend() != null) {
|
||||
PresenceModel presenceModel = contact.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
img.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
img.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
img.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
img.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,12 @@ import org.linphone.activities.LinphoneActivity;
|
|||
import org.linphone.core.Address;
|
||||
import org.linphone.core.ChatRoom;
|
||||
import org.linphone.core.ChatRoomListenerStub;
|
||||
import org.linphone.core.ChatRoomSecurityLevel;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.fragments.FragmentsAvailable;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
|
|
@ -48,6 +51,9 @@ import android.widget.TableLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class ContactDetailsFragment extends Fragment implements OnClickListener {
|
||||
private LinphoneContact contact;
|
||||
private ImageView editContact, deleteContact, back;
|
||||
|
|
@ -169,11 +175,34 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
@SuppressLint("InflateParams")
|
||||
private void displayContact(LayoutInflater inflater, View view) {
|
||||
ImageView contactPicture = view.findViewById(R.id.contact_picture);
|
||||
if (contact.hasPhoto()) {
|
||||
LinphoneUtils.setImagePictureFromUri(getActivity(), contactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
} else {
|
||||
contactPicture.setImageBitmap(ContactsManager.getInstance().getDefaultAvatarBitmap());
|
||||
}
|
||||
ProxyConfig prx = LinphoneManager.getLc().getDefaultProxyConfig();
|
||||
Address ourUri = (prx != null) ? prx.getIdentityAddress() : null;
|
||||
ChatRoomSecurityLevel securityLevel = getSecurityLevelForSipUri(LinphoneManager.getLc(), ourUri, contact.getFriend().getAddress());
|
||||
if (securityLevel == ChatRoomSecurityLevel.Safe) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (securityLevel == ChatRoomSecurityLevel.Unsafe) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contact.getFriend().getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
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) {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextView contactName = view.findViewById(R.id.contact_name);
|
||||
contactName.setText(contact.getFullName());
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ import org.linphone.core.FriendList;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
import org.linphone.fragments.FragmentsAvailable;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphoneUtils;
|
||||
|
|
@ -64,6 +65,7 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class ContactsListFragment extends Fragment implements OnClickListener, OnItemClickListener, ContactsUpdatedListener {
|
||||
private LayoutInflater mInflater;
|
||||
|
|
@ -636,15 +638,22 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_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(), contact.getFriend().getAddress().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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,13 @@ import org.linphone.core.PresenceActivity;
|
|||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.SearchResult;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class SearchContactsListAdapter extends BaseAdapter {
|
||||
|
||||
|
|
@ -282,15 +284,22 @@ public class SearchContactsListAdapter extends BaseAdapter {
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), contact.getAddress().asStringUriOnly());
|
||||
if (zrtpStatus == ZrtpPeerStatus.Valid) {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_secure2);
|
||||
} else if (zrtpStatus == ZrtpPeerStatus.Invalid) {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_unsecure);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
} else {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
} else {
|
||||
holder.avatar.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
}
|
||||
}
|
||||
view.setTag(R.id.contact_search_name, address != null ? address : a);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.linphone.core.ChatRoomSecurityLevel;
|
|||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.ZrtpPeerStatus;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -64,6 +65,7 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
|
||||
import static org.linphone.LinphoneUtils.getSecurityLevelForSipUri;
|
||||
import static org.linphone.LinphoneUtils.getZrtpStatus;
|
||||
|
||||
public class HistoryListFragment extends Fragment implements OnClickListener, OnItemClickListener, ContactsUpdatedListener {
|
||||
private ListView historyList;
|
||||
|
|
@ -505,15 +507,22 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
} else if (securityLevel == ChatRoomSecurityLevel.Encrypted) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
if (!ContactsManager.getInstance().isContactPresenceDisabled() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.getFriend().getPresenceModel();
|
||||
if (presenceModel != null) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_secure1);
|
||||
ZrtpPeerStatus zrtpStatus = getZrtpStatus(LinphoneManager.getLc(), address.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() && c != null && c.getFriend() != null) {
|
||||
PresenceModel presenceModel = c.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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 11f4c9c61feece2d46909ae62e91ac1bace64c2c
|
||||
Subproject commit eff062756d4e0eeba1fb76b61bce013478326f88
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 94f0d8d3a267f899e9604604c74e876baba26306
|
||||
Subproject commit c0dd09fd195d0d1c030d4803a192272327b6b6b6
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit e3746d4b80d1a18e4b9f2e76890d6b4b2daad4e3
|
||||
Subproject commit 867e55f4e0325836a16b7a3e474d03bf1a7a73fe
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5460eefe4c196cc1159b3013ee3b7f8d31e0ae49
|
||||
Subproject commit 366f1a596c38f85433092d2cdc50beeb084fd569
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit f006ec334fc20316e67cb5a20d1a90f4c70ee08f
|
||||
Subproject commit 197ef9bd42e4825d2bcdf604f85f0405a9b7295a
|
||||
Loading…
Add table
Reference in a new issue