From a30856246a9da3f00b6a926e44785b8ff38a90c4 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 2 Sep 2016 16:09:54 +0200 Subject: [PATCH 1/4] Fixed jar liblinphone SDK --- custom_rules.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_rules.xml b/custom_rules.xml index 8e0297fe8..27e5e6956 100644 --- a/custom_rules.xml +++ b/custom_rules.xml @@ -74,7 +74,7 @@ + includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/tools/**/*.class"/> @@ -93,7 +93,7 @@ + includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class org/linphone/tools/**/*.class"/> From 0425c1bc331252329b522061cc82fe551f079bcf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 2 Sep 2016 21:54:35 +0200 Subject: [PATCH 2/4] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 56b08128b..dce0f4d49 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 56b08128b41a64ae95b708ce61f1a9328016d3a4 +Subproject commit dce0f4d495d4ab239d39eb42b5bd2b3ef609815e From ca4f078b9ed0bb0162a267fe3571c2134def53d8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 5 Sep 2016 11:22:11 +0200 Subject: [PATCH 3/4] Ask for READ_PHONE_STATE permission when starting LinphoneActivity (used to detect GSM calls and pause SIP calls) --- src/org/linphone/CallOutgoingActivity.java | 1 - src/org/linphone/LinphoneActivity.java | 32 ++++++++++++++++------ src/org/linphone/LinphoneManager.java | 1 - 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/org/linphone/CallOutgoingActivity.java b/src/org/linphone/CallOutgoingActivity.java index 2b9d1715f..4e890e39e 100644 --- a/src/org/linphone/CallOutgoingActivity.java +++ b/src/org/linphone/CallOutgoingActivity.java @@ -24,7 +24,6 @@ import java.util.List; import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; -import org.linphone.core.LinphoneCallParams; import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCoreListenerBase; import org.linphone.core.Reason; diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 0da686b64..415c0708a 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -1140,6 +1140,10 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta return true; } + public void checkAndRequestReadPhoneStatePermission() { + checkAndRequestPermission(Manifest.permission.READ_PHONE_STATE, 0); + } + public void checkAndRequestReadExternalStoragePermission() { checkAndRequestPermission(Manifest.permission.READ_EXTERNAL_STORAGE, 0); } @@ -1237,6 +1241,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { ContactsManager.getInstance().enableContactsAccess(); } + checkAndRequestReadPhoneStatePermission(); ContactsManager.getInstance().fetchContactsAsync(); fetchedContactsOnce = true; break; @@ -1264,15 +1269,26 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta int contacts = getPackageManager().checkPermission(Manifest.permission.READ_CONTACTS, getPackageName()); Log.i("[Permission] Contacts permission is " + (contacts == PackageManager.PERMISSION_GRANTED ? "granted" : "denied")); - if (contacts == PackageManager.PERMISSION_GRANTED && !fetchedContactsOnce) { - ContactsManager.getInstance().enableContactsAccess(); - ContactsManager.getInstance().fetchContactsAsync(); - fetchedContactsOnce = true; - } else if (contacts != PackageManager.PERMISSION_GRANTED && !willContactsPermissionBeAsked()) { - ContactsManager.getInstance().fetchContactsAsync(); - fetchedContactsOnce = true; + int readPhone = getPackageManager().checkPermission(Manifest.permission.READ_PHONE_STATE, getPackageName()); + Log.i("[Permission] Read phone state permission is " + (readPhone == PackageManager.PERMISSION_GRANTED ? "granted" : "denied")); + + if (contacts == PackageManager.PERMISSION_GRANTED) { + if (readPhone == PackageManager.PERMISSION_DENIED) { + checkAndRequestReadPhoneStatePermission(); + } + if (!fetchedContactsOnce) { + ContactsManager.getInstance().enableContactsAccess(); + ContactsManager.getInstance().fetchContactsAsync(); + fetchedContactsOnce = true; + } } else { - checkAndRequestReadContactsPermission(); + if (!willContactsPermissionBeAsked()) { + ContactsManager.getInstance().fetchContactsAsync(); + fetchedContactsOnce = true; + checkAndRequestReadPhoneStatePermission(); + } else { + checkAndRequestReadContactsPermission(); // This will ask for Read_Phone_State permission on it's cb + } } } diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 4b7d463be..4210c7a0e 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -66,7 +66,6 @@ import org.linphone.core.PublishState; import org.linphone.core.SubscriptionState; import org.linphone.core.TunnelConfig; import org.linphone.mediastream.Log; -import org.linphone.mediastream.MediastreamerAndroidContext; import org.linphone.mediastream.Version; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera; From bb618d51af8fb78f1ce62c2acfdbd490b88c40d8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 6 Sep 2016 14:51:13 +0200 Subject: [PATCH 4/4] add missing tool in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index e2269f90d..8bcdc5a00 100644 --- a/README +++ b/README @@ -9,7 +9,7 @@ To build liblinphone for Android, you must: ------------------------------------------- 0) download the Android sdk (API 23 at least) with platform-tools and tools updated to latest revision, then add both 'tools' and 'platform-tools' folders in your path. 1) download the Android ndk (version r11c or 12b) from google and add it to your path (no symlink !!!). -2) install yasm, nasm, ant, python, cmake and vim-common +2) install yasm, nasm, ant, python, intltoolize, cmake and vim-common On 64 bits linux systems you'll need the ia32-libs package With the latest Debian (multiarch), you need this: dpkg --add-architecture i386