From 0b3c2af42029b67e92fa920d5db0ff65ed7ab3d1 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 6 Sep 2016 16:30:27 +0200 Subject: [PATCH 1/5] Fix starting of bluetooth manager --- src/org/linphone/LinphoneLauncherActivity.java | 6 ++++++ src/org/linphone/LinphoneManager.java | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/LinphoneLauncherActivity.java b/src/org/linphone/LinphoneLauncherActivity.java index 0b52e46ec..fc1c3a9c7 100644 --- a/src/org/linphone/LinphoneLauncherActivity.java +++ b/src/org/linphone/LinphoneLauncherActivity.java @@ -21,6 +21,7 @@ package org.linphone; import static android.content.Intent.ACTION_MAIN; import org.linphone.assistant.RemoteProvisioningActivity; +import org.linphone.mediastream.Version; import org.linphone.tutorials.TutorialLauncherActivity; import android.app.Activity; @@ -72,6 +73,11 @@ public class LinphoneLauncherActivity extends Activity { } else { classToStart = LinphoneActivity.class; } + + // We need LinphoneService to start bluetoothManager + if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) { + BluetoothManager.getInstance().initBluetooth(); + } mHandler.postDelayed(new Runnable() { @Override diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 4210c7a0e..76dd19ba5 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -295,6 +295,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag instance = new LinphoneManager(c); instance.startLibLinphone(c); + TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE); boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE; setGsmIdle(gsmIdle); @@ -776,10 +777,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag updateNetworkReachability(); - if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) { - BluetoothManager.getInstance().initBluetooth(); - } - resetCameraFromPreferences(); } From 2abe8b5b84c8bd2931bd2f4da254b8a38ede004d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 7 Sep 2016 11:09:35 +0200 Subject: [PATCH 2/5] Update bctoolbox, belle-sip and linphone submodules. --- submodules/bctoolbox | 2 +- submodules/belle-sip | 2 +- submodules/linphone | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/submodules/bctoolbox b/submodules/bctoolbox index 921a21332..c11f1e70a 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit 921a21332c327ae99900267950be0bfd2d7c6126 +Subproject commit c11f1e70ad21d81e443b9678f22b9e2b2d0a8b77 diff --git a/submodules/belle-sip b/submodules/belle-sip index 0b825c68d..b61dd749d 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 0b825c68d2c69385d277f7833f21c6c0a3f4ad8d +Subproject commit b61dd749dec10d1f4bb715de6e0868b50c40f0d6 diff --git a/submodules/linphone b/submodules/linphone index dce0f4d49..510e9d92d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit dce0f4d495d4ab239d39eb42b5bd2b3ef609815e +Subproject commit 510e9d92d051c0bedc2803669f6aa81bda7c3cb9 From c71aa32289c4ff7f9b8164bb2a233f3a1ef9e22d Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 7 Sep 2016 15:11:24 +0200 Subject: [PATCH 3/5] Fix rotation issue on some fragments on tablets --- src/org/linphone/LinphoneActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 415c0708a..1d0cbe75a 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -1312,8 +1312,12 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta } if (isTablet()) { + // Prevent fragmentContainer2 to be visible when rotating the device LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2); - if (currentFragment == FragmentsAvailable.DIALER) { + if (currentFragment == FragmentsAvailable.DIALER + || currentFragment == FragmentsAvailable.ABOUT + || currentFragment == FragmentsAvailable.SETTINGS + || currentFragment == FragmentsAvailable.ACCOUNT_SETTINGS) { ll.setVisibility(View.GONE); } } From 7b8029c35f8101ee91993e5495a9da28622deeda Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 7 Sep 2016 16:11:55 +0200 Subject: [PATCH 4/5] Hide spinner in contact list if there are no contacts --- src/org/linphone/ContactsListFragment.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/org/linphone/ContactsListFragment.java b/src/org/linphone/ContactsListFragment.java index 4e75ce1d6..66984af71 100644 --- a/src/org/linphone/ContactsListFragment.java +++ b/src/org/linphone/ContactsListFragment.java @@ -333,6 +333,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O noSipContact.setVisibility(View.GONE); noContact.setVisibility(View.GONE); contactsList.setVisibility(View.VISIBLE); + contactsFetchInProgress.setVisibility(View.GONE); if (onlyDisplayLinphoneContacts) { contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); @@ -344,11 +345,6 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O edit.setEnabled(true); } ContactsManager.getInstance().setLinphoneContactsPrefered(onlyDisplayLinphoneContacts); - if (contactsList.getCount() == 0) { - contactsFetchInProgress.setVisibility(View.VISIBLE); - } else { - contactsFetchInProgress.setVisibility(View.GONE); - } } private void changeContactsToggle() { From 5378f46b56f417bc565828aae3ac67c1d07dce41 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 8 Sep 2016 11:35:07 +0200 Subject: [PATCH 5/5] When receiving a push, do work on main thread --- src/org/linphone/gcm/GCMService.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/gcm/GCMService.java b/src/org/linphone/gcm/GCMService.java index ebfc1273f..79e49aab0 100644 --- a/src/org/linphone/gcm/GCMService.java +++ b/src/org/linphone/gcm/GCMService.java @@ -77,11 +77,15 @@ public class GCMService extends GCMBaseIntentService { } @Override - protected void onRegistered(Context context, String regId) { + protected void onRegistered(Context context, final String regId) { initLogger(context); Log.d("[Push Notification] Registered: " + regId); - - LinphonePreferences.instance().setPushNotificationRegistrationID(regId); + UIThreadDispatcher.dispatch(new Runnable(){ + @Override + public void run() { + LinphonePreferences.instance().setPushNotificationRegistrationID(regId); + } + }); } @Override @@ -89,7 +93,12 @@ public class GCMService extends GCMBaseIntentService { initLogger(context); Log.w("[Push Notification] Unregistered: " + regId); - LinphonePreferences.instance().setPushNotificationRegistrationID(null); + UIThreadDispatcher.dispatch(new Runnable(){ + @Override + public void run() { + LinphonePreferences.instance().setPushNotificationRegistrationID(null); + } + }); } protected String[] getSenderIds(Context context) {