Merge branch 'master' into dev_phonenumber

Conflicts:
	src/org/linphone/LinphoneActivity.java
This commit is contained in:
Simon Morlat 2016-09-06 15:58:02 +02:00
commit 1e322f80d8
8 changed files with 30 additions and 16 deletions

2
README
View file

@ -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

View file

@ -74,7 +74,7 @@
<property name="out.library.jar.file" location="${out.absolute.dir}/liblinphone.jar" />
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class"/>
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/tools/**/*.class"/>
<fileset dir="submodules/linphone/java" >
<include name="common/org/linphone/core/*.java"/>
<include name="j2se/org/linphone/core/*.java"/>
@ -93,7 +93,7 @@
<property name="out.library.jar.file" location="${out.absolute.dir}/linphone.jar" />
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class"/>
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class org/linphone/tools/**/*.class"/>
<fileset dir="submodules/linphone/java" >
<include name="common/org/linphone/core/*.java"/>
<include name="j2se/org/linphone/core/*.java"/>

View file

@ -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;

View file

@ -1157,6 +1157,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);
}
@ -1259,6 +1263,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;
@ -1286,15 +1291,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
}
}
}

View file

@ -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;

@ -1 +1 @@
Subproject commit 921a21332c327ae99900267950be0bfd2d7c6126
Subproject commit c11f1e70ad21d81e443b9678f22b9e2b2d0a8b77

@ -1 +1 @@
Subproject commit 0b825c68d2c69385d277f7833f21c6c0a3f4ad8d
Subproject commit 13b4498265ec3e4d356caf79da4cc7d7eb5afef4

@ -1 +1 @@
Subproject commit 56b08128b41a64ae95b708ce61f1a9328016d3a4
Subproject commit 510e9d92d051c0bedc2803669f6aa81bda7c3cb9