diff --git a/res/drawable-xhdpi/presence_online.png b/res/drawable-xhdpi/presence_online.png index 79fc3098d..2f14a0808 100644 Binary files a/res/drawable-xhdpi/presence_online.png and b/res/drawable-xhdpi/presence_online.png differ diff --git a/res/layout/avatar_with_presence.xml b/res/layout/avatar_with_presence.xml index 5f886e42d..103aa6e45 100644 --- a/res/layout/avatar_with_presence.xml +++ b/res/layout/avatar_with_presence.xml @@ -49,7 +49,7 @@ android:layout_alignRight="@+id/contact_picture_big" android:adjustViewBounds="true" android:layout_marginRight="7dp" - android:layout_marginBottom="10dp" + android:layout_marginBottom="7dp" android:scaleType="centerInside" android:src="@drawable/presence_unregistered" /> diff --git a/res/raw/linphonerc_factory b/res/raw/linphonerc_factory index 9368b2186..785851bef 100644 --- a/res/raw/linphonerc_factory +++ b/res/raw/linphonerc_factory @@ -1,57 +1,24 @@ + +# +#This file shall not contain path referencing package name, in order to be portable when app is renamed. +#Paths to resources must be set from LinphoneManager, after creating LinphoneCore. [net] -download_bw=380 -upload_bw=380 mtu=1300 -firewall_policy=ice -stun_server=85.233.205.218 + +[app] +animations=0 +show_login_view=1 +debug_popup_magic=#1234 +debug=1 +server_url=http://85.233.205.218:443/xmlrpc [sip] -contact="Linphone Android" -use_info=0 -use_ipv6=0 -keepalive_period=30000 guess_hostname=1 inc_timeout=15 register_only_when_network_is_up=1 auto_net_state_mon=0 auto_answer_replacing_calls=1 ping_with_options=0 -root_ca=/data/user/0/org.linphone/files/rootca.pem -verify_server_certs=1 -verify_server_cn=1 -media_encryption=zrtp -multi_transport_migration_done=1 -in_call_timeout=0 -delayed_timeout=4 -register_only_when_upnp_is_ok=1 -media_encryption_mandatory=1 -sip_port=-1 -sip_tcp_port=-1 -sip_tls_port=-1 -srtp_crypto_suites=AES_CM_256_HMAC_SHA1_80 -default_proxy=0 -rls_uri=sip:rls@sip.example.org -use_rls_presence=1 - -[video] -size=qvga -device=Android1 -display=1 -capture=1 - -[app] -sharing_server=https://www.linphone.org:444/lft.php -tunnel=disabled -push_notification=1 -animations=0 -show_login_view=1 -debug_popup_magic=#1234 -debug=1 -server_url=http://85.233.205.218:443/xmlrpc -first_launch=0 - -[tunnel] -port=443 [rtp] audio_rtp_port=7076 @@ -60,204 +27,17 @@ audio_jitt_comp=60 video_jitt_comp=60 nortp_timeout=30 disable_upnp=1 -text_rtp_port=11078 -audio_adaptive_jitt_comp_enabled=1 -video_adaptive_jitt_comp_enabled=1 [sound] +playback_dev_id= +ringer_dev_id= +capture_dev_id= dtmf_player_amp=0.1 -ec_calibrator_cool_tones=1 -local_ring=/data/user/0/org.linphone/files/oldphone_mono.wav -remote_ring=/data/user/0/org.linphone/files/ringback.wav -playback_gain_db=0.000000 -mic_gain_db=0.000000 + #remove this property for any application that is not Linphone public version itself +ec_calibrator_cool_tones=1 + [misc] max_calls=10 -log_collection_upload_server_url=https://www.linphone.org:444/lft.php -uuid=3ac65678-272f-47d9-8aff-19950c565687 -friends_migration_done=1 -user_certificates_path=/data/user/0/org.linphone/files -file_transfer_server_url=https://www.linphone.org:444/lft.php -config-uri=https://85.233.205.218/xmlrpc?username=margaux&password=cotcot&domain=sip.orangecyberdefense.com - -[audio_codec_0] -mime=opus -rate=48000 -channels=2 -enabled=1 - -[audio_codec_1] -mime=SILK -rate=16000 -channels=1 -enabled=1 - -[audio_codec_2] -mime=speex -rate=16000 -channels=1 -enabled=1 - -[audio_codec_3] -mime=speex -rate=8000 -channels=1 -enabled=1 - -[audio_codec_4] -mime=PCMU -rate=8000 -channels=1 -enabled=1 - -[audio_codec_5] -mime=PCMA -rate=8000 -channels=1 -enabled=1 - -[audio_codec_6] -mime=GSM -rate=8000 -channels=1 -enabled=0 - -[audio_codec_7] -mime=G722 -rate=8000 -channels=1 -enabled=0 - -[audio_codec_8] -mime=iLBC -rate=8000 -channels=1 -enabled=0 - -[audio_codec_9] -mime=mpeg4-generic -rate=16000 -channels=1 -enabled=0 - -[audio_codec_10] -mime=mpeg4-generic -rate=22050 -channels=1 -enabled=0 - -[audio_codec_11] -mime=mpeg4-generic -rate=32000 -channels=1 -enabled=0 - -[audio_codec_12] -mime=mpeg4-generic -rate=44100 -channels=1 -enabled=0 - -[audio_codec_13] -mime=mpeg4-generic -rate=48000 -channels=1 -enabled=0 - -[audio_codec_14] -mime=iSAC -rate=16000 -channels=1 -enabled=0 - -[audio_codec_15] -mime=speex -rate=32000 -channels=1 -enabled=0 - -[audio_codec_16] -mime=SILK -rate=8000 -channels=1 -enabled=0 - -[audio_codec_17] -mime=SILK -rate=12000 -channels=1 -enabled=0 - -[audio_codec_18] -mime=SILK -rate=24000 -channels=1 -enabled=0 - -[audio_codec_19] -mime=L16 -rate=44100 -channels=2 -enabled=0 - -[audio_codec_20] -mime=L16 -rate=44100 -channels=1 -enabled=0 - -[video_codec_0] -mime=VP8 -rate=90000 -enabled=1 - -[video_codec_1] -mime=H264 -rate=90000 -enabled=1 -recv_fmtp=profile-level-id=42801F - -[friend_1] -url="Sylvain Berfini" - -[friend_0] -url="Margaux Clerc" - -[friend_2] -url="Jehan Monnier" - -[friend_3] -url="Marielle Rellier" - -[friend_4] -url="Simon Morlat" - -[friend_5] -url="François Grisez" - -[friend_5] -url="L'ami invisible'" - -[proxy_0] -reg_proxy= -reg_route= -reg_identity=sip:testios@sip.linphone.org -quality_reporting_enabled=0 -quality_reporting_interval=0 -reg_expires=3600 -reg_sendregister=1 -publish=1 -avpf=-1 -avpf_rr_interval=5 -dial_escape_plus=0 -privacy=32768 -refkey=push_notification -publish_expires=600 - -[auth_info_0] -username=testios -passwd=testtest -realm=sip.linphone.org -domain=sip.linphone.org +log_collection_upload_server_url=https://www.linphone.org:444/lft.php \ No newline at end of file diff --git a/src/org/linphone/ContactDetailsFragment.java b/src/org/linphone/ContactDetailsFragment.java index b554bd5ed..6c3e7d8bf 100644 --- a/src/org/linphone/ContactDetailsFragment.java +++ b/src/org/linphone/ContactDetailsFragment.java @@ -260,9 +260,9 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener }); dialog.show(); } - if (id == R.id.back) { + */ if (id == R.id.back) { LinphoneActivity.instance().displayContacts(false); } - */ + } } diff --git a/src/org/linphone/ContactsListFragment.java b/src/org/linphone/ContactsListFragment.java index 89fe69659..0be52ce8d 100644 --- a/src/org/linphone/ContactsListFragment.java +++ b/src/org/linphone/ContactsListFragment.java @@ -433,15 +433,6 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O separatorText.setVisibility(View.VISIBLE); } - /* ImageView icon = (ImageView) view.findViewById(R.id.contact_picture); - if (contact.hasPhoto()) { - LinphoneUtils.setImagePictureFromUri(getActivity(), icon, contact.getPhotoUri(), contact.getThumbnailUri()); - } else if (contact.getPhotoUri() != null) { - icon.setImageURI(contact.getPhotoUri()); - } else { - icon.setImageResource(R.drawable.avatar); - } - */ AvatarWithPresenceImage avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence); avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_SMALL); if(contact != null && contact.isLinphoneFriend()) { diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 3b764770d..4ea064840 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -283,13 +283,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta @Override public void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) { - Log.e("===>> LinphoneActivity : notifyPresenceReceived 1 : "+lf.getName().toString()); - /* for(AvatarWithPresenceImage listener : listeners){ - Log.e("===>> LinphoneActivity : notifyPresenceReceived 2 : "+lf.getName().toString()); - if(listener.isThisFriend(lf)){ - listener.updatePresenceIcon(lc, lf); - } - }*/ + } }; @@ -751,7 +745,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta } public void displayChat(String sipUri) { - Log.e("===>>> displayChat"); if (getResources().getBoolean(R.bool.disable_chat)) { return; } @@ -1293,8 +1286,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta @Override protected void onPause() { - Log.e("LinphoneActivity - onPause"); - //LinphoneManager.getInstance().enableProxyPublish(false); + LinphoneManager.getInstance().enableProxyPublish(false); getIntent().putExtra("PreviousActivity", 0); super.onPause(); @@ -1348,7 +1340,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta refreshAccounts(); displayMissedCalls(LinphoneManager.getLc().getMissedCallsCount()); - LinphoneManager.getInstance().changeStatusToOnline(); + //LinphoneManager.getInstance().changeStatusToOnline(); + LinphoneManager.getInstance().enableProxyPublish(true); if (getIntent().getIntExtra("PreviousActivity", 0) != CALL_ACTIVITY){ if (LinphoneManager.getLc().getCalls().length > 0) { @@ -1375,6 +1368,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta } } } + } @Override diff --git a/src/org/linphone/LinphoneContact.java b/src/org/linphone/LinphoneContact.java index 4ff84769c..8e25244ab 100644 --- a/src/org/linphone/LinphoneContact.java +++ b/src/org/linphone/LinphoneContact.java @@ -374,7 +374,7 @@ public class LinphoneContact implements Serializable, Comparable> enableProxyPublish : "+enabled); LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); if(lc != null ) { LinphoneProxyConfig[] proxyList = lc.getProxyConfigList(); - Log.e("==>> enableProxyPublish : LC not null : "+proxyList.length); + if(!enabled) + changeStatusToOffline(); for (LinphoneProxyConfig proxyConfig : proxyList) { - Log.e("==>> enableProxyPublish : proxyList"); proxyConfig.edit(); proxyConfig.enablePublish(enabled); proxyConfig.done(); } + if(enabled) + changeStatusToOnline(); } } public void changeStatusToOnline() { + LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); - if (isInstanciated() && lc != null && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Online) { - lc.getPresenceModel().getActivity().setType(PresenceActivityType.Online); - } else if (isInstanciated() && lc != null && !isPresenceModelActivitySet()) { - PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Online, null); + if (isInstanciated() && lc != null ){ + PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.TV, null); lc.setPresenceModel(model); } } public void changeStatusToOnThePhone() { LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); - if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.OnThePhone) { - lc.getPresenceModel().getActivity().setType(PresenceActivityType.OnThePhone); - } else if (isInstanciated() && !isPresenceModelActivitySet()) { + if (isInstanciated() && lc != null) { PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.OnThePhone, null); lc.setPresenceModel(model); } @@ -389,10 +386,8 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag public void changeStatusToOffline() { LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); - if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Offline) { - lc.getPresenceModel().getActivity().setType(PresenceActivityType.Offline); - } else if (isInstanciated() && !isPresenceModelActivitySet()) { - PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Offline, null); + if (isInstanciated() && lc != null) { + PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Away, null); lc.setPresenceModel(model); } } @@ -827,7 +822,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag } public static synchronized void destroy() { - instance.enableProxyPublish(false); if (instance == null) return; getInstance().changeStatusToOffline(); sExited = true; @@ -870,10 +864,9 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag } public void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) { - Log.e("===>> LinphoneManager - notifyPresenceReceived : "+lf.getName()); for(AvatarWithPresenceImage listener : listeners){ if(listener.isThisFriend(lf)){ - Log.e("===>> LinphoneManager : notifyPresenceReceived 2 : "+lf.getName().toString()); + Log.e("===>> LinphoneManager : notifyPresenceReceived : "+lf.getName().toString()+" - "+lf.getPresenceModel().getActivity().getType()); listener.updatePresenceIcon(lc, lf); } } diff --git a/src/org/linphone/ui/AvatarWithPresenceImage.java b/src/org/linphone/ui/AvatarWithPresenceImage.java index b61fbc92d..4d7fc35f7 100644 --- a/src/org/linphone/ui/AvatarWithPresenceImage.java +++ b/src/org/linphone/ui/AvatarWithPresenceImage.java @@ -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); - } else if (presenceModel.getActivity().getType() == PresenceActivityType.TV ) { + } else if ((presenceModel.getActivity().getType() == PresenceActivityType.TV ) || (presenceModel.getActivity().getType() == PresenceActivityType.Online)) { friendStatusSmall.setImageResource(R.drawable.presence_online); friendStatusBig.setImageResource(R.drawable.presence_online); } else { diff --git a/submodules/linphone b/submodules/linphone index 465559dd6..6a02a5701 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 465559dd662d8e1c2a05dea873154c1d2dbdd241 +Subproject commit 6a02a570180eaedf0377317758481ec82cbc791f