mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
Adding new JNI function
This commit is contained in:
parent
21c32fb781
commit
36554835ff
3 changed files with 17 additions and 0 deletions
|
|
@ -8360,6 +8360,15 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setEmail(JNIEn
|
|||
return (jint) status;
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getPrefix(JNIEnv *env, jobject thiz, jlong ptr, jstring jphonenumber) {
|
||||
char buff[4];
|
||||
const char *phone_number = GetStringUTFChars(env, jphonenumber);
|
||||
int prefix = linphone_dial_plan_lookup_ccc_from_e164(phone_number);
|
||||
snprintf(buff, sizeof(buff), "%d", prefix);
|
||||
ReleaseStringUTFChars(env, jphonenumber, phone_number);
|
||||
return (jstring) env->NewStringUTF(buff);
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getEmail(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
const char *email = linphone_account_creator_get_email(account_creator);
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ public interface LinphoneAccountCreator {
|
|||
|
||||
String getEmail();
|
||||
|
||||
String getPrefix(String phone);
|
||||
|
||||
Status isAccountUsed();
|
||||
|
||||
Status createAccount();
|
||||
|
|
|
|||
|
|
@ -166,6 +166,12 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
return getEmail(nativePtr);
|
||||
}
|
||||
|
||||
private native String getPrefix(long ptr, String s);
|
||||
@Override
|
||||
public String getPrefix(String phone) {
|
||||
return getPrefix(nativePtr, phone);
|
||||
}
|
||||
|
||||
private native int isAccountUsed(long ptr);
|
||||
@Override
|
||||
public Status isAccountUsed() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue