[Presence] test in progress + updates

This commit is contained in:
Brieuc Viel 2016-04-20 10:19:04 +02:00
parent ab761d1a1d
commit 04530e1f64
9 changed files with 23 additions and 20 deletions

View file

@ -414,7 +414,6 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
View view = null;
LinphoneContact contact = (LinphoneContact) getItem(position);
if (contact == null) return null;
Log.e("===>> getView - contact : isAndroidContact = "+contact.isAndroidContact()+" - is LinphoneFriend = "+contact.isLinphoneFriend());
contact.refresh();
if (convertView != null) {
@ -448,11 +447,9 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
if(contact != null ) {
avatarWithPresenceImage.setLinphoneContact(contact);
if (contact.isLinphoneFriend()) {
Log.e("===>> getView - contact != null");
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
}
}else {
Log.e("===>> getView - everything == null");
avatarWithPresenceImage.setLinphoneContact(contact);
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
}

View file

@ -287,7 +287,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
for(AvatarWithPresenceImage listener : listeners){
Log.e("===>> LinphoneActivity : notifyPresenceReceived 2 : "+lf.getName().toString());
if(listener.isThisFriend(lf)){
listener.updatePresenceIcon(lc, lf);
listener.updatePresenceIcon(lc, lf);
}
}
}

View file

@ -371,6 +371,13 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
hasSipAddress = false;
if (!isAndroidContact() && isLinphoneFriend()) {
if(getFriendPresenceModel() == null){
friend.enableSubscribes(true);
friend.setIncSubscribePolicy(SubscribePolicy.SPAccept);
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.TV, null);
friend.setPresenceModel(model);
}
Log.e("===>>> LinphoneContact : isAndroidContact & isLinphoneFriend : ");
fullName = friend.getName();
thumbnailUri = null;
photoUri = null;
@ -380,6 +387,7 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
hasSipAddress = true;
}
} else if (isAndroidContact()) {
Log.e("===>>> LinphoneContact : isAndroidContact : "+getFriendPresenceModel().toString());
String id = getAndroidId();
getContactNames(id);
setThumbnailUri(getContactPictureUri(id));
@ -422,9 +430,9 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
friend.enableSubscribes(true);
friend.setIncSubscribePolicy(SubscribePolicy.SPAccept);
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Online, null);
//friend.setPresenceModel(model);
friend.setPresenceModel(model);
Log.e("===>>> LinphoneContact - isLinphoneFriend :" + getFriendPresenceModel().toString());
}
}
@ -442,7 +450,6 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
public PresenceModel getFriendPresenceModel(){
if(friend != null) {
Log.e("===>> getFriendPresenceModel - friend != null : "+friend.getPresenceModel());
return friend.getPresenceModel();
}
else return null;

View file

@ -352,11 +352,13 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
private void enableProxyPublish( boolean enabled) {
LinphoneCore lc = getLcIfManagerNotDestroyedOrNull();
LinphoneProxyConfig[] proxyList = lc.getProxyConfigList();
for (LinphoneProxyConfig proxyConfig : proxyList){
proxyConfig.edit();
proxyConfig.enablePublish(enabled);
proxyConfig.done();
if(lc != null ) {
LinphoneProxyConfig[] proxyList = lc.getProxyConfigList();
for (LinphoneProxyConfig proxyConfig : proxyList) {
proxyConfig.edit();
proxyConfig.enablePublish(enabled);
proxyConfig.done();
}
}
}

View file

@ -92,11 +92,10 @@ public class AvatarWithPresenceImage extends RelativeLayout implements onPresenc
friendStatusBig = (ImageView) this.findViewById(R.id.friend_status_big);
PresenceModel presenceModel = contact.getFriendPresenceModel();
PresenceBasicStatus basicStatus = presenceModel.getBasicStatus();
Log.e("===>>> updateAvatarPresence basicStatus = "+ presenceModel.getBasicStatus().toString()+" - "+ presenceModel.getActivity().getType().toString());
if (basicStatus == PresenceBasicStatus.Closed) {
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
friendStatusBig.setImageResource(R.drawable.presence_unregistered);
Log.e("===>>> updateAvatarPresence basicStatus == Closed");
} else if (presenceModel.getActivity().getType() == PresenceActivityType.TV ) {
friendStatusSmall.setImageResource(R.drawable.presence_online);
friendStatusBig.setImageResource(R.drawable.presence_online);
@ -105,11 +104,9 @@ public class AvatarWithPresenceImage extends RelativeLayout implements onPresenc
friendStatusBig.setImageResource(R.drawable.presence_offline);
}
} else if(contact.isLinphoneFriend()){
Log.e("===>>> updateAvatarPresence friend infromation is null ");
friendStatusSmall.setImageResource(R.drawable.presence_offline);
friendStatusBig.setImageResource(R.drawable.presence_offline);
} else{
Log.e("===>>> updateAvatarPresence friend is null ");
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
}

@ -1 +1 @@
Subproject commit 29e865b5566890ae1ba3a50b0699337ef926d6b5
Subproject commit d5e453b0c45154d424a7b80617fce380fe7d3c4c

@ -1 +1 @@
Subproject commit 129a9f0cbb880361d1f10c08fd4c2bd188ec0565
Subproject commit da7030bb322f4cd74638e6710007b1470c1b602e

@ -1 +1 @@
Subproject commit 8a82f7a645765480a90f41ce18c85cf9a62dcc14
Subproject commit 5a6196e3d0a5d5b2998522379c9fdc2788378570

@ -1 +1 @@
Subproject commit f0cd38ef228cf26bfdd0fd8bd037fd74fb1e1c5a
Subproject commit 16e21507be68b24d8beb95775fe639a903efcefe