From a4e3f3b41a2f58a97c4eb82e19703e47134d392f Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 11 Oct 2017 16:48:11 +0200 Subject: [PATCH 01/16] Update submodule belle-sip --- submodules/belle-sip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/belle-sip b/submodules/belle-sip index e4e6459e0..e3b9709cc 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit e4e6459e0ed148e2e3ad2394b8acf4743bde8c36 +Subproject commit e3b9709cc5c01250aa944a7cb6f8abbee885113f From d8f336b88457a4727c512d4e8418a30a803b3504 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 11 Oct 2017 17:03:28 +0200 Subject: [PATCH 02/16] Replace Mediastreamer log by Android log in LinphoneLauncherActivity --- src/android/org/linphone/LinphoneLauncherActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/org/linphone/LinphoneLauncherActivity.java b/src/android/org/linphone/LinphoneLauncherActivity.java index 142d7e7f7..b9eebb084 100644 --- a/src/android/org/linphone/LinphoneLauncherActivity.java +++ b/src/android/org/linphone/LinphoneLauncherActivity.java @@ -25,9 +25,9 @@ import android.content.pm.ActivityInfo; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.util.Log; import org.linphone.assistant.RemoteProvisioningActivity; -import org.linphone.mediastream.Log; import org.linphone.mediastream.Version; import org.linphone.tutorials.TutorialLauncherActivity; @@ -158,12 +158,12 @@ public class LinphoneLauncherActivity extends Activity { } if (uriToResolve != null) { addressToCall = ContactsManager.getInstance().getAddressOrNumberForAndroidContact(getContentResolver(), uriToResolve); - Log.i("Intent has uri to resolve : " + uriToResolve.toString()); + Log.i("LinphoneLauncher", "Intent has uri to resolve : " + uriToResolve.toString()); uriToResolve = null; } if (addressToCall != null) { newIntent.putExtra("SipUriOrNumber", addressToCall); - Log.i("Intent has address to call : " + addressToCall); + Log.i("LinphoneLauncher", "Intent has address to call : " + addressToCall); addressToCall = null; } startActivity(newIntent); From 65740199bf0a5beed35f428eb6cbf88e92d15342 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 12 Oct 2017 12:01:34 +0200 Subject: [PATCH 03/16] Fixing login view for tablet 533dp --- res/layout-sw533dp-land/assistant_login.xml | 23 +++++++++++++++++++ res/layout/assistant_login.xml | 2 -- .../linphone/assistant/AssistantActivity.java | 7 +++--- .../org/linphone/assistant/LoginFragment.java | 6 +++-- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/res/layout-sw533dp-land/assistant_login.xml b/res/layout-sw533dp-land/assistant_login.xml index 1708857cf..255446aad 100644 --- a/res/layout-sw533dp-land/assistant_login.xml +++ b/res/layout-sw533dp-land/assistant_login.xml @@ -146,6 +146,29 @@ android:gravity="center" android:layout_margin="10dp"> + + + + + + Date: Thu, 12 Oct 2017 13:55:51 +0200 Subject: [PATCH 04/16] update submodules (fix issues in test suite) --- submodules/linphone | 2 +- submodules/mediastreamer2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/linphone b/submodules/linphone index 145b05ee8..8d4d87548 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 145b05ee8dddeca71518f327a69b474ac048f77a +Subproject commit 8d4d875486e7263354c12dedb3a3b589c52a9bda diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index 7666b7580..d2fd45276 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7666b75803e8aa3df88183a40ec4f6b8a04f2018 +Subproject commit d2fd45276de9a91353cf1e12dbe47f02e885198d From 6cd271d956ffaabbc5ae0ee48a1ab1c8a90e58f7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 13 Oct 2017 19:40:38 +0200 Subject: [PATCH 05/16] remove dns server handling and in-call wake lock management, because it is taken in charge by the library now. --- src/android/org/linphone/LinphoneManager.java | 38 ------------------- submodules/linphone | 2 +- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/android/org/linphone/LinphoneManager.java b/src/android/org/linphone/LinphoneManager.java index 7aca759d8..d78212bf9 100644 --- a/src/android/org/linphone/LinphoneManager.java +++ b/src/android/org/linphone/LinphoneManager.java @@ -179,7 +179,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag private IntentFilter mCallIntentFilter; private IntentFilter mNetworkIntentFilter; private Handler mHandler = new Handler(); - private WakeLock mIncallWakeLock; private WakeLock mProximityWakelock; private LinphoneAccountCreator accountCreator; private static List mPendingChatFileMessage; @@ -1011,7 +1010,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag boolean wifiOnly = LinphonePreferences.instance().isWifiOnlyEnabled(); if (wifiOnly){ if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) { - setDnsServers(); mLc.setNetworkReachable(true); } else { @@ -1027,7 +1025,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag Log.i("Connectivity has changed."); mLc.setNetworkReachable(false); } - setDnsServers(); mLc.setNetworkReachable(true); mLastNetworkType = curtype; } @@ -1465,12 +1462,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag routeAudioToReceiver(); } } - if (mIncallWakeLock != null && mIncallWakeLock.isHeld()) { - mIncallWakeLock.release(); - Log.i("Last call ended: releasing incall (CPU only) wake lock"); - } else { - Log.i("Last call ended: no incall (CPU only) wake lock were held"); - } } } if (state == State.CallUpdatedByRemote) { @@ -1497,15 +1488,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag if (state == State.StreamsRunning) { startBluetooth(); setAudioManagerInCallMode(); - if (mIncallWakeLock == null) { - mIncallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "incall"); - } - if (!mIncallWakeLock.isHeld()) { - Log.i("New call active : acquiring incall (CPU only) wake lock"); - mIncallWakeLock.acquire(); - } else { - Log.i("New call active while incall (CPU only) wake lock already active"); - } } } @@ -1826,26 +1808,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag dozeModeEnabled = b; } - public void setDnsServers() { - if (mConnectivityManager == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.M) - return; - - if (mConnectivityManager.getActiveNetwork() == null - || mConnectivityManager.getLinkProperties(mConnectivityManager.getActiveNetwork()) == null) - return; - - int i = 0; - List inetServers = null; - inetServers = mConnectivityManager.getLinkProperties(mConnectivityManager.getActiveNetwork()).getDnsServers(); - - String[] servers = new String[inetServers.size()]; - - for (InetAddress address : inetServers) { - servers[i++] = address.getHostAddress(); - } - mLc.setDnsServers(servers); - } - public String getmDynamicConfigFile() { return mDynamicConfigFile; } diff --git a/submodules/linphone b/submodules/linphone index 8d4d87548..af3d44e60 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8d4d875486e7263354c12dedb3a3b589c52a9bda +Subproject commit af3d44e60d7547a02f29d3b3948bfa681a769c59 From 7fec8f1a6b79e124041ceb43f56b6e2bacba0edb Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 16 Oct 2017 15:04:41 +0200 Subject: [PATCH 06/16] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index af3d44e60..d16223338 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit af3d44e60d7547a02f29d3b3948bfa681a769c59 +Subproject commit d16223338c3e43da4386b2428089be0bc21b1907 From 3254b9ac571b84486839bbc9d59c62b8b3596d34 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 16 Oct 2017 16:55:25 +0200 Subject: [PATCH 07/16] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index d16223338..868c54118 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit d16223338c3e43da4386b2428089be0bc21b1907 +Subproject commit 868c54118ff75fd8333d7727995794f639e658bd From a30a2e83a44bd22761b7c1e5ad3b083a242f32c0 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 17 Oct 2017 11:37:55 +0200 Subject: [PATCH 08/16] update ms2 --- submodules/mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index d2fd45276..b7e4901fb 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit d2fd45276de9a91353cf1e12dbe47f02e885198d +Subproject commit b7e4901fb8bc4b1095b5dcddd691ae288cd86d0e From 7cfa70cc2dc0a6789bc870652dc267d008f799c0 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 17 Oct 2017 14:33:55 +0200 Subject: [PATCH 09/16] Fixing issue on create account close #114 --- src/android/org/linphone/assistant/CreateAccountFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/org/linphone/assistant/CreateAccountFragment.java b/src/android/org/linphone/assistant/CreateAccountFragment.java index 592a37cd8..4a6edd085 100644 --- a/src/android/org/linphone/assistant/CreateAccountFragment.java +++ b/src/android/org/linphone/assistant/CreateAccountFragment.java @@ -591,6 +591,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForRequestStatus(status) , AssistantActivity.instance()); } else { + LinphoneManager.getLc().getConfig().loadXmlFile(LinphoneManager.getInstance().getmDynamicConfigFile()); accountCreator.isPhoneNumberUsed(); } } else { From de62b3e77821d2c66a2e4c87ba34b94efd29d727 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 17 Oct 2017 14:43:07 +0200 Subject: [PATCH 10/16] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 868c54118..fba4cd41c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 868c54118ff75fd8333d7727995794f639e658bd +Subproject commit fba4cd41cfe9aad4fd6cfdceffe88c2d603917db From bc48b3d7ec9df5642a72dac277096dcac4981810 Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Tue, 17 Oct 2017 15:41:20 +0200 Subject: [PATCH 11/16] [SASNotif] Do not display SAS notif if not in screen locked mode --- src/android/org/linphone/StatusFragment.java | 32 ++++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/android/org/linphone/StatusFragment.java b/src/android/org/linphone/StatusFragment.java index c5845aa86..7d5e8fae0 100644 --- a/src/android/org/linphone/StatusFragment.java +++ b/src/android/org/linphone/StatusFragment.java @@ -17,21 +17,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import org.linphone.assistant.AssistantActivity; -import org.linphone.core.CallDirection; -import org.linphone.core.LinphoneCall; -import org.linphone.core.LinphoneContent; -import org.linphone.core.LinphoneCore; -import org.linphone.core.LinphoneCore.MediaEncryption; -import org.linphone.core.LinphoneCore.RegistrationState; -import org.linphone.core.LinphoneCoreListenerBase; -import org.linphone.core.LinphoneEvent; -import org.linphone.core.LinphoneProxyConfig; -import org.linphone.mediastream.Log; import android.app.Activity; import android.app.Dialog; import android.app.Fragment; +import android.app.KeyguardManager; import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; @@ -48,6 +38,18 @@ import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; +import org.linphone.assistant.AssistantActivity; +import org.linphone.core.CallDirection; +import org.linphone.core.LinphoneCall; +import org.linphone.core.LinphoneContent; +import org.linphone.core.LinphoneCore; +import org.linphone.core.LinphoneCore.MediaEncryption; +import org.linphone.core.LinphoneCore.RegistrationState; +import org.linphone.core.LinphoneCoreListenerBase; +import org.linphone.core.LinphoneEvent; +import org.linphone.core.LinphoneProxyConfig; +import org.linphone.mediastream.Log; + public class StatusFragment extends Fragment { private Handler refreshHandler = new Handler(); private TextView statusText, voicemailCount; @@ -413,8 +415,12 @@ public class StatusFragment extends Fragment { zrtpToRead = token.substring(2); } - LinphoneService.instance().displaySasNotification(token); - + // Obiane specific dev : display sas notif only if screen locked + KeyguardManager myKM = (KeyguardManager) getActivity().getSystemService(Context.KEYGUARD_SERVICE); + if( myKM.inKeyguardRestrictedInputMode()) { + //Screen is locked + LinphoneService.instance().displaySasNotification(call.getAuthenticationToken()); + } TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText); String newText = getString(R.string.zrtp_dialog1).replace("%s", zrtpToRead) + getString(R.string.zrtp_dialog2).replace("%s", zrtpToListen); From eee8451eeef08ab7b9b26eb42c4998b017becd14 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 17 Oct 2017 15:54:21 +0200 Subject: [PATCH 12/16] Fixing last commit concerning create account --- src/android/org/linphone/assistant/CreateAccountFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/org/linphone/assistant/CreateAccountFragment.java b/src/android/org/linphone/assistant/CreateAccountFragment.java index 4a6edd085..fd332852d 100644 --- a/src/android/org/linphone/assistant/CreateAccountFragment.java +++ b/src/android/org/linphone/assistant/CreateAccountFragment.java @@ -325,6 +325,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On } else { if (useEmail.isChecked()) accountCreator.setPhoneNumber(null, null); if (!getResources().getBoolean(R.bool.isTablet) || getUsername().length() > 0) { + LinphoneManager.getLc().getConfig().loadXmlFile(LinphoneManager.getInstance().getmDynamicConfigFile()); accountCreator.isAccountUsed(); } else { LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForUsernameStatus(LinphoneAccountCreator.UsernameCheck.TooShort) From 342ab8c41abbdf22171443334b2d4f086c21ea93 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 17 Oct 2017 17:24:14 +0200 Subject: [PATCH 13/16] Fix service notification on Android O --- src/android/org/linphone/LinphoneService.java | 8 -------- .../org/linphone/compatibility/ApiTwentySixPlus.java | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/android/org/linphone/LinphoneService.java b/src/android/org/linphone/LinphoneService.java index 67b86a5ff..3ffadd427 100644 --- a/src/android/org/linphone/LinphoneService.java +++ b/src/android/org/linphone/LinphoneService.java @@ -315,10 +315,6 @@ public final class LinphoneService extends Service { notifIntent.putExtra("Notification", true); mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT); - if (Version.sdkAboveOrEqual(Version.API26_O_80)) { - disableNotificationsAutomaticRegistrationStatusContent(); - } - Bitmap bm = null; try { bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); @@ -756,10 +752,6 @@ public final class LinphoneService extends Service { } } - public void disableNotificationsAutomaticRegistrationStatusContent() { - mDisableRegistrationStatus = true; - } - private synchronized void sendNotification(int level, int textId) { String text = getString(textId); if (text.contains("%s") && LinphoneManager.getLc() != null) { diff --git a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java index 53453cbdb..b1111c6d6 100644 --- a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java +++ b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java @@ -40,7 +40,7 @@ public class ApiTwentySixPlus { String id = context.getString(R.string.notification_channel_id); CharSequence name = context.getString(R.string.content_title_notification); String description = context.getString(R.string.content_title_notification); - int importance = NotificationManager.IMPORTANCE_HIGH; + int importance = NotificationManager.IMPORTANCE_DEFAULT; NotificationChannel mChannel = new NotificationChannel(id, name, importance); mChannel.setDescription(description); mChannel.enableLights(true); From 926712a704c30a6446c3d3b739886cc61158df3c Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 18 Oct 2017 10:18:58 +0200 Subject: [PATCH 14/16] Disable notification service on Android O --- res/values/non_localizable_custom.xml | 1 + res/values/strings.xml | 1 + src/android/org/linphone/LinphoneService.java | 8 ++++++- .../compatibility/ApiTwentySixPlus.java | 23 ++++++++++++++----- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml index 891c6eb1e..1879eedbe 100644 --- a/res/values/non_localizable_custom.xml +++ b/res/values/non_localizable_custom.xml @@ -93,6 +93,7 @@ linphone-android@belledonne-communications.com true true + linphone_notification_service_id linphone_notification_id 1000 7000 diff --git a/res/values/strings.xml b/res/values/strings.xml index 37123420a..6ba093432 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -485,5 +485,6 @@ Call options Audio route Exit conference + Linphone Service Linphone Notification diff --git a/src/android/org/linphone/LinphoneService.java b/src/android/org/linphone/LinphoneService.java index 3ffadd427..3217c0b07 100644 --- a/src/android/org/linphone/LinphoneService.java +++ b/src/android/org/linphone/LinphoneService.java @@ -307,6 +307,12 @@ public final class LinphoneService extends Service { dumpDeviceInformation(); dumpInstalledLinphoneInformation(); + //Disable service notification for Android O + if ((Version.sdkAboveOrEqual(Version.API26_O_80))) { + LinphonePreferences.instance().setServiceNotificationVisibility(false); + mDisableRegistrationStatus = true; + } + mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); mNM.cancel(INCALL_NOTIF_ID); // in case of crash the icon is not removed Compatibility.CreateChannel(this); @@ -393,7 +399,7 @@ public final class LinphoneService extends Service { @Override public void globalState(LinphoneCore lc,LinphoneCore.GlobalState state, String message) { - if (state == GlobalState.GlobalOn && displayServiceNotification()) { + if (!mDisableRegistrationStatus && state == GlobalState.GlobalOn && displayServiceNotification()) { sendNotification(IC_LEVEL_ORANGE, R.string.notification_started); } } diff --git a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java index b1111c6d6..2360bd0c6 100644 --- a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java +++ b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java @@ -8,6 +8,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.graphics.Bitmap; +import android.media.AudioAttributes; import android.view.ViewTreeObserver; import org.linphone.R; @@ -37,12 +38,22 @@ public class ApiTwentySixPlus { public static void CreateChannel(Context context) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - String id = context.getString(R.string.notification_channel_id); - CharSequence name = context.getString(R.string.content_title_notification); - String description = context.getString(R.string.content_title_notification); - int importance = NotificationManager.IMPORTANCE_DEFAULT; + // Create service notification channel + String id = context.getString(R.string.notification_service_channel_id); + CharSequence name = context.getString(R.string.content_title_notification_service); + String description = context.getString(R.string.content_title_notification_service); + int importance = NotificationManager.IMPORTANCE_NONE; NotificationChannel mChannel = new NotificationChannel(id, name, importance); mChannel.setDescription(description); + mChannel.enableVibration(false); + notificationManager.createNotificationChannel(mChannel); + // Create message/call notification channel + id = context.getString(R.string.notification_channel_id); + name = context.getString(R.string.content_title_notification); + description = context.getString(R.string.content_title_notification); + importance = NotificationManager.IMPORTANCE_HIGH; + mChannel = new NotificationChannel(id, name, importance); + mChannel.setDescription(description); mChannel.enableLights(true); mChannel.setLightColor(context.getColor(R.color.notification_color_led)); mChannel.enableLights(true); @@ -103,7 +114,7 @@ public class ApiTwentySixPlus { Notification notif; if (largeIcon != null) { - notif = new Notification.Builder(context, context.getString(R.string.notification_channel_id)) + notif = new Notification.Builder(context, context.getString(R.string.notification_service_channel_id)) .setContentTitle(title) .setContentText(message) .setSmallIcon(icon, level) @@ -114,7 +125,7 @@ public class ApiTwentySixPlus { .setPriority(priority) .build(); } else { - notif = new Notification.Builder(context, context.getString(R.string.notification_channel_id)) + notif = new Notification.Builder(context, context.getString(R.string.notification_service_channel_id)) .setContentTitle(title) .setContentText(message) .setSmallIcon(icon, level) From 9b559abf8665573dedea30718cacc61bef1eb155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Wed, 18 Oct 2017 17:17:06 +0200 Subject: [PATCH 15/16] Update mediastreamer2 module for a bugfix --- submodules/mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index b7e4901fb..279e03c54 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit b7e4901fb8bc4b1095b5dcddd691ae288cd86d0e +Subproject commit 279e03c54ad635a7370fbe8cece50518169f29b0 From 4b395acd7542186885b88a323a61430f335eaef5 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 19 Oct 2017 11:29:57 +0200 Subject: [PATCH 16/16] Fixing error with push notification token on the first login --- res/raw/assistant_create.rc | 2 +- src/android/org/linphone/LinphonePreferences.java | 4 +++- src/android/org/linphone/assistant/AssistantActivity.java | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/res/raw/assistant_create.rc b/res/raw/assistant_create.rc index e6fe33ffb..bcfa7a073 100644 --- a/res/raw/assistant_create.rc +++ b/res/raw/assistant_create.rc @@ -7,7 +7,7 @@ sip:voip-metrics@sip.linphone.org;transport=tls 1 180 - 600 + 31536000 sip:?@sip.linphone.org <sip:sip.linphone.org;transport=tls> 1 diff --git a/src/android/org/linphone/LinphonePreferences.java b/src/android/org/linphone/LinphonePreferences.java index 17061f1d4..6b0f61c2e 100644 --- a/src/android/org/linphone/LinphonePreferences.java +++ b/src/android/org/linphone/LinphonePreferences.java @@ -362,7 +362,9 @@ public class LinphonePreferences { if (tempExpire != null) { try { prxCfg.setExpires(Integer.parseInt(tempExpire)); - } catch (NumberFormatException nfe) { } + } catch (NumberFormatException nfe) { + throw new LinphoneCoreException(nfe); + } } prxCfg.enableAvpf(tempAvpfEnabled); diff --git a/src/android/org/linphone/assistant/AssistantActivity.java b/src/android/org/linphone/assistant/AssistantActivity.java index a0a14851b..93ef61c93 100644 --- a/src/android/org/linphone/assistant/AssistantActivity.java +++ b/src/android/org/linphone/assistant/AssistantActivity.java @@ -365,9 +365,6 @@ private static AssistantActivity instance; proxyConfig.setIdentity(addr.asString()); - if (LinphonePreferences.instance() != null) - proxyConfig.setContactUriParameters(LinphonePreferences.instance().getPushNotificationRegistrationID()); - if (accountCreator.getPhoneNumber() != null && accountCreator.getPhoneNumber().length() > 0) proxyConfig.setDialPrefix(accountCreator.getPrefix(accountCreator.getPhoneNumber())); @@ -388,6 +385,9 @@ private static AssistantActivity instance; lc.setDefaultProxyConfig(proxyConfig); + if (LinphonePreferences.instance() != null) + LinphonePreferences.instance().setPushNotificationEnabled(true); + if (ContactsManager.getInstance() != null) ContactsManager.getInstance().fetchContactsAsync();