mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Add new implementation of acocunt creator to Java
This commit is contained in:
parent
d594898253
commit
85c6355213
3 changed files with 359 additions and 262 deletions
|
|
@ -8157,15 +8157,15 @@ extern "C" void Java_org_linphone_core_LinphoneXmlRpcSessionImpl_sendRequest(JNI
|
|||
|
||||
// Account creator
|
||||
|
||||
static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
ms_error("cannot attach VM\n");
|
||||
return;
|
||||
}
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8182,7 +8182,7 @@ static void account_creator_is_account_used(LinphoneAccountCreator *creator, Lin
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8190,8 +8190,8 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8208,7 +8208,7 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8216,8 +8216,8 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8234,7 +8234,7 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8242,8 +8242,8 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8260,7 +8260,7 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8268,8 +8268,8 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8286,7 +8286,7 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8294,8 +8294,8 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8312,7 +8312,7 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8320,8 +8320,8 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8338,7 +8338,7 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8346,8 +8346,8 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8364,7 +8364,7 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8372,8 +8372,8 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea
|
|||
return;
|
||||
}
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8390,7 +8390,7 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea
|
|||
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
|
||||
}
|
||||
|
||||
static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
|
||||
static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -8398,10 +8398,8 @@ static void account_creator_password_updated(LinphoneAccountCreator *creator, Li
|
|||
return;
|
||||
}
|
||||
|
||||
ms_warning("test callback password updated");
|
||||
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
|
||||
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
|
||||
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
|
||||
if (listener == NULL) {
|
||||
ms_error("account_creator_response() notification without listener");
|
||||
return ;
|
||||
|
|
@ -8434,26 +8432,26 @@ extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_unref(JNIEnv *
|
|||
extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
jobject listener = env->NewGlobalRef(jlistener);
|
||||
LinphoneAccountCreatorCbs *cbs;
|
||||
LinphoneAccountCreatorResponseCbs *cbs;
|
||||
|
||||
cbs = linphone_account_creator_get_callbacks(account_creator);
|
||||
linphone_account_creator_cbs_set_user_data(cbs, listener);
|
||||
linphone_account_creator_cbs_set_is_account_used(cbs, account_creator_is_account_used);
|
||||
linphone_account_creator_cbs_set_create_account(cbs, account_creator_create_account);
|
||||
linphone_account_creator_cbs_set_activate_account(cbs, account_creator_activate_account);
|
||||
linphone_account_creator_cbs_set_link_phone_number_with_account(cbs, account_creator_link_phone_number_with_account);
|
||||
linphone_account_creator_cbs_set_activate_phone_number_link(cbs, account_creator_activate_phone_number_link);
|
||||
linphone_account_creator_cbs_set_is_account_activated(cbs, account_creator_is_account_activated);
|
||||
linphone_account_creator_cbs_set_recover_phone_account(cbs, account_creator_phone_account_recovered);
|
||||
linphone_account_creator_cbs_set_is_phone_number_used(cbs, account_creator_is_phone_number_used);
|
||||
linphone_account_creator_cbs_set_is_account_linked(cbs, account_creator_is_account_linked);
|
||||
linphone_account_creator_cbs_set_update_hash(cbs, account_creator_password_updated);
|
||||
cbs = linphone_account_creator_get_responses_cbs(account_creator);
|
||||
linphone_account_creator_responses_cbs_set_user_data(cbs, listener);
|
||||
linphone_account_creator_responses_cbs_set_is_account_exist_cb(cbs, account_creator_is_account_used);
|
||||
linphone_account_creator_responses_cbs_set_create_account_cb(cbs, account_creator_create_account);
|
||||
linphone_account_creator_responses_cbs_set_activate_account_cb(cbs, account_creator_activate_account);
|
||||
linphone_account_creator_responses_cbs_set_link_account_cb(cbs, account_creator_link_phone_number_with_account);
|
||||
linphone_account_creator_responses_cbs_set_activate_alias_cb(cbs, account_creator_activate_phone_number_link);
|
||||
linphone_account_creator_responses_cbs_set_is_account_activated_cb(cbs, account_creator_is_account_activated);
|
||||
linphone_account_creator_responses_cbs_set_recover_account_cb(cbs, account_creator_phone_account_recovered);
|
||||
linphone_account_creator_responses_cbs_set_is_alias_used_cb(cbs, account_creator_is_phone_number_used);
|
||||
linphone_account_creator_responses_cbs_set_is_account_linked_cb(cbs, account_creator_is_account_linked);
|
||||
linphone_account_creator_responses_cbs_set_update_account_cb(cbs, account_creator_password_updated);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setUsername(JNIEnv *env, jobject thiz, jlong ptr, jstring jusername) {
|
||||
const char *username = GetStringUTFChars(env, jusername);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_username(account_creator, username);
|
||||
LinphoneUsernameCheck status = linphone_account_creator_set_username(account_creator, username);
|
||||
ReleaseStringUTFChars(env, jusername, username);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8468,7 +8466,7 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setPhoneNumber
|
|||
const char *phone_number = GetStringUTFChars(env, jphonenumber);
|
||||
const char *country_code = GetStringUTFChars(env, jcountrycode);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_phone_number(account_creator, phone_number, country_code);
|
||||
LinphonePhoneNumberMask status = linphone_account_creator_set_phone_number(account_creator, phone_number, country_code);
|
||||
ReleaseStringUTFChars(env, jphonenumber, phone_number);
|
||||
ReleaseStringUTFChars(env, jcountrycode, country_code);
|
||||
return (jint) status;
|
||||
|
|
@ -8483,7 +8481,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getPhoneNum
|
|||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setPassword(JNIEnv *env, jobject thiz, jlong ptr, jstring jpassword) {
|
||||
const char *password = GetStringUTFChars(env, jpassword);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_password(account_creator, password);
|
||||
LinphonePasswordCheck status = linphone_account_creator_set_password(account_creator, password);
|
||||
ReleaseStringUTFChars(env, jpassword, password);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8497,7 +8495,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getPassword
|
|||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setHa1(JNIEnv *env, jobject thiz, jlong ptr, jstring jha1) {
|
||||
const char *ha1 = GetStringUTFChars(env, jha1);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_ha1(account_creator, ha1);
|
||||
LinphonePasswordCheck status = linphone_account_creator_set_ha1(account_creator, ha1);
|
||||
ReleaseStringUTFChars(env, jha1, ha1);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8511,7 +8509,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getHa1(JNIE
|
|||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setActivationCode(JNIEnv *env, jobject thiz, jlong ptr, jstring jcode) {
|
||||
const char *activation_code = GetStringUTFChars(env, jcode);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_activation_code(account_creator, activation_code);
|
||||
LinphoneActivationCodeCheck status = linphone_account_creator_set_activation_code(account_creator, activation_code);
|
||||
ReleaseStringUTFChars(env, jcode, activation_code);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8519,55 +8517,15 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setActivationC
|
|||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setLanguage(JNIEnv *env, jobject thiz, jlong ptr, jstring jlang) {
|
||||
const char *lang = GetStringUTFChars(env, jlang);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_language(account_creator, lang);
|
||||
LinphoneLanguageCheck status = linphone_account_creator_set_language(account_creator, lang);
|
||||
ReleaseStringUTFChars(env, jlang, lang);
|
||||
return (jint) status;
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setTransport(JNIEnv *env, jobject thiz, jlong ptr, jint jtransport) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_transport(account_creator, (LinphoneTransportType)jtransport);
|
||||
return (jint) status;
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_getTransport(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneTransportType transport = linphone_account_creator_get_transport(account_creator);
|
||||
return (jint) transport;
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setDomain(JNIEnv *env, jobject thiz, jlong ptr, jstring jdomain) {
|
||||
const char *domain = GetStringUTFChars(env, jdomain);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_domain(account_creator, domain);
|
||||
ReleaseStringUTFChars(env, jdomain, domain);
|
||||
return (jint) status;
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getDomain(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
const char *domain = linphone_account_creator_get_domain(account_creator);
|
||||
return domain ? env->NewStringUTF(domain) : NULL;
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setRoute(JNIEnv *env, jobject thiz, jlong ptr, jstring jroute) {
|
||||
const char *route = GetStringUTFChars(env, jroute);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_route(account_creator, route);
|
||||
ReleaseStringUTFChars(env, jroute, route);
|
||||
return (jint) status;
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getRoute(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
const char *route = linphone_account_creator_get_route(account_creator);
|
||||
return route ? env->NewStringUTF(route) : NULL;
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setDisplayName(JNIEnv *env, jobject thiz, jlong ptr, jstring jname) {
|
||||
const char *name = GetStringUTFChars(env, jname);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_display_name(account_creator, name);
|
||||
LinphoneUsernameCheck status = linphone_account_creator_set_display_name(account_creator, name);
|
||||
ReleaseStringUTFChars(env, jname, name);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8581,7 +8539,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getDisplayN
|
|||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_setEmail(JNIEnv *env, jobject thiz, jlong ptr, jstring jemail) {
|
||||
const char *email = GetStringUTFChars(env, jemail);
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
LinphoneAccountCreatorStatus status = linphone_account_creator_set_email(account_creator, email);
|
||||
LinphoneEmailCheck status = linphone_account_creator_set_email(account_creator, email);
|
||||
ReleaseStringUTFChars(env, jemail, email);
|
||||
return (jint) status;
|
||||
}
|
||||
|
|
@ -8603,7 +8561,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAccountCreatorImpl_getEmail(JN
|
|||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_isAccountUsed(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
return (jint) linphone_account_creator_is_account_used(account_creator);
|
||||
return (jint) linphone_account_creator_is_account_linked(account_creator);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_createAccount(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
|
|
@ -8623,7 +8581,7 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_isAccountLinke
|
|||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_isPhoneNumberUsed(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
return (jint) linphone_account_creator_is_phone_number_used(account_creator);
|
||||
return (jint) linphone_account_creator_is_alias_used(account_creator);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_isAccountActivated(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
|
|
@ -8633,26 +8591,28 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_isAccountActiv
|
|||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_linkPhoneNumberWithAccount(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
return (jint) linphone_account_creator_link_phone_number_with_account(account_creator);
|
||||
return (jint) linphone_account_creator_link_account(account_creator);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_activatePhoneNumberLink(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
return (jint) linphone_account_creator_activate_phone_number_link(account_creator);
|
||||
return (jint) linphone_account_creator_activate_alias(account_creator);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_recoverPhoneAccount(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
return (jint) linphone_account_creator_recover_phone_account(account_creator);
|
||||
return (jint) linphone_account_creator_recover_account(account_creator);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_updatePassword(JNIEnv *env, jobject thiz, jlong ptr, jstring jpasswd) {
|
||||
jint status;
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
const char* passwd = GetStringUTFChars(env, jpasswd);
|
||||
status = (jint) linphone_account_creator_update_password(account_creator, passwd);
|
||||
ReleaseStringUTFChars(env, jpasswd, passwd);
|
||||
return status;
|
||||
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
|
||||
const char* passwd = GetStringUTFChars(env, jpasswd);
|
||||
linphone_account_creator_set_user_data(account_creator, (void*)passwd);
|
||||
status = (jint) linphone_account_creator_update_account(account_creator);
|
||||
linphone_account_creator_set_user_data(account_creator, (void*)NULL);
|
||||
ReleaseStringUTFChars(env, jpasswd, passwd);
|
||||
return status;
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneAccountCreatorImpl_configure(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
|
|
|
|||
|
|
@ -23,68 +23,263 @@ import org.linphone.core.LinphoneAddress.TransportType;
|
|||
|
||||
public interface LinphoneAccountCreator {
|
||||
interface LinphoneAccountCreatorListener {
|
||||
void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorAccountActivated(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorAccountLinkedWithPhoneNumber(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorPhoneNumberLinkActivated(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, Status status);
|
||||
void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorAccountActivated(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorAccountLinkedWithPhoneNumber(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorPhoneNumberLinkActivated(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, RequestStatus RequestStatus);
|
||||
}
|
||||
|
||||
public static class Status {
|
||||
static private Vector<Status> values = new Vector<Status>();
|
||||
public static class UsernameCheck {
|
||||
static private Vector<UsernameCheck> values = new Vector<UsernameCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static Status Ok = new Status(0, "Ok");
|
||||
public final static Status Failed = new Status(1, "Failed");
|
||||
public final static Status AccountCreated = new Status(2, "AccountCreated");
|
||||
public final static Status AccountNotCreated = new Status(3, "AccountNotCreated");
|
||||
public final static Status AccountExist = new Status(4, "AccountExist");
|
||||
public final static Status AccountExistWithAlias = new Status(5, "AccountExistWithAlias");
|
||||
public final static Status AccountNotExist = new Status(6, "AccountNotExist");
|
||||
public final static Status AccountActivated = new Status(7, "AccountActivated");
|
||||
public final static Status AccountAlreadyActivated = new Status(8, "AccountAlreadyActivated");
|
||||
public final static Status AccountNotActivated = new Status(9, "AccountNotActivated");
|
||||
public final static Status AccountLinked = new Status(10, "AccountLinked");
|
||||
public final static Status AccountNotLinked = new Status(11, "AccountNotLinked");
|
||||
public final static Status EmailInvalid = new Status(12, "EmailInvalid");
|
||||
public final static Status UsernameInvalid = new Status(13, "UsernameInvalid");
|
||||
public final static Status UsernameTooShort = new Status(14, "UsernameTooShort");
|
||||
public final static Status UsernameTooLong = new Status(15, "UsernameTooLong");
|
||||
public final static Status UsernameInvalidSize = new Status(16, "UsernameInvalidSize");
|
||||
public final static Status PhoneNumberInvalid = new Status(17, "PhoneNumberInvalid");
|
||||
public final static Status PhoneNumberTooShort = new Status(18, "PhoneNumberTooShort");
|
||||
public final static Status PhoneNumberTooLong = new Status(19, "PhoneNumberTooLong");
|
||||
public final static Status PhoneNumberUsedAccount = new Status(20, "PhoneNumberUsed");
|
||||
public final static Status PhoneNumberUsedAlias = new Status(21, "PhoneNumberUsed");
|
||||
public final static Status PhoneNumberNotUsed = new Status(22, "PhoneNumberNotUsed");
|
||||
public final static Status PasswordTooShort = new Status(23, "PasswordTooShort");
|
||||
public final static Status PasswordTooLong = new Status(24, "PasswordTooLong");
|
||||
public final static Status DomainInvalid = new Status(25, "DomainInvalid");
|
||||
public final static Status RouteInvalid = new Status(26, "RouteInvalid");
|
||||
public final static Status DisplayNameInvalid = new Status(27, "DisplayNameInvalid");
|
||||
public final static Status TransportNotSupported = new Status(28, "TransportNotSupported");
|
||||
public final static Status CountryCodeInvalid = new Status(29, "CountryCodeInvalid");
|
||||
public final static Status ErrorServer = new Status(30, "ErrorServer");
|
||||
public final static UsernameCheck Ok = new UsernameCheck(0, "Ok");
|
||||
public final static UsernameCheck TooShort = new UsernameCheck(1, "TooShort");
|
||||
public final static UsernameCheck TooLong = new UsernameCheck(2, "TooLong");
|
||||
public final static UsernameCheck InvalidCharacters = new UsernameCheck(3, "InvalidCharacters");
|
||||
public final static UsernameCheck Invalid = new UsernameCheck(4, "Invalid");
|
||||
|
||||
private Status(int value, String stringValue) {
|
||||
private UsernameCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static Status fromInt(int value) {
|
||||
public static UsernameCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
Status state = (Status) values.elementAt(i);
|
||||
UsernameCheck state = (UsernameCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("Status not found [" + value + "]");
|
||||
throw new RuntimeException("UsernameCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PhoneNumberCheck {
|
||||
static private Vector<PhoneNumberCheck> values = new Vector<PhoneNumberCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static PhoneNumberCheck Ok = new PhoneNumberCheck(0x1, "Ok");
|
||||
public final static PhoneNumberCheck TooShort = new PhoneNumberCheck(0x2, "TooShort");
|
||||
public final static PhoneNumberCheck TooLong = new PhoneNumberCheck(0x4, "TooLong");
|
||||
public final static PhoneNumberCheck CountryCodeInvalid = new PhoneNumberCheck(0x8, "CountryCodeInvalid");
|
||||
public final static PhoneNumberCheck Invalid = new PhoneNumberCheck(0x10, "Invalid");
|
||||
|
||||
private PhoneNumberCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static PhoneNumberCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
PhoneNumberCheck state = (PhoneNumberCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("UsernameCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EmailCheck {
|
||||
static private Vector<EmailCheck> values = new Vector<EmailCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static EmailCheck Ok = new EmailCheck(0, "Ok");
|
||||
public final static EmailCheck Malformed = new EmailCheck(1, "Malformed");
|
||||
public final static EmailCheck InvalidCharacters = new EmailCheck(2, "InvalidCharacters");
|
||||
|
||||
private EmailCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static EmailCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
EmailCheck state = (EmailCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("EmailCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PasswordCheck {
|
||||
static private Vector<PasswordCheck> values = new Vector<PasswordCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static PasswordCheck Ok = new PasswordCheck(0, "Ok");
|
||||
public final static PasswordCheck TooShort = new PasswordCheck(1, "TooShort");
|
||||
public final static PasswordCheck TooLong = new PasswordCheck(2, "TooLong");
|
||||
public final static PasswordCheck InvalidCharacters = new PasswordCheck(3, "InvalidCharacters");
|
||||
public final static PasswordCheck MissingCharacters = new PasswordCheck(4, "MissingCharacters");
|
||||
|
||||
private PasswordCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static PasswordCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
PasswordCheck state = (PasswordCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("PasswordCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LanguageCheck {
|
||||
static private Vector<LanguageCheck> values = new Vector<LanguageCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static LanguageCheck Ok = new LanguageCheck(0, "Ok");
|
||||
|
||||
private LanguageCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static LanguageCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
LanguageCheck state = (LanguageCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("LanguageCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ActivationCodeCheck {
|
||||
static private Vector<ActivationCodeCheck> values = new Vector<ActivationCodeCheck>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static ActivationCodeCheck Ok = new ActivationCodeCheck(0, "Ok");
|
||||
public final static ActivationCodeCheck TooShort = new ActivationCodeCheck(1, "TooShort");
|
||||
public final static ActivationCodeCheck TooLong = new ActivationCodeCheck(2, "TooLong");
|
||||
public final static ActivationCodeCheck InvalidCharacters = new ActivationCodeCheck(3, "InvalidCharacters");
|
||||
|
||||
private ActivationCodeCheck(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static ActivationCodeCheck fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
ActivationCodeCheck state = (ActivationCodeCheck) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("ActivationCodeCheck not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RequestStatus {
|
||||
static private Vector<RequestStatus> values = new Vector<RequestStatus>();
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
public final int value() { return mValue; }
|
||||
|
||||
public final static RequestStatus Ok = new RequestStatus(0, "Ok");
|
||||
public final static RequestStatus Failed = new RequestStatus(1, "Failed");
|
||||
public final static RequestStatus MissingArguments = new RequestStatus(2, "MissingArguments");
|
||||
public final static RequestStatus MissingCallbacks = new RequestStatus(3, "MissingCallbacks");
|
||||
|
||||
public final static RequestStatus AccountCreated = new RequestStatus(4, "AccountCreated");
|
||||
public final static RequestStatus AccountNotCreated = new RequestStatus(5, "AccountNotCreated");
|
||||
|
||||
public final static RequestStatus AccountExist = new RequestStatus(6, "AccountExist");
|
||||
public final static RequestStatus AccountExistWithAlias = new RequestStatus(7, "AccountExistWithAlias");
|
||||
public final static RequestStatus AccountNotExist = new RequestStatus(8, "AccountNotExist");
|
||||
public final static RequestStatus AliasIsAccount = new RequestStatus(9, "AliasIsAccount");
|
||||
public final static RequestStatus AliasExist = new RequestStatus(10, "AliasExist");
|
||||
public final static RequestStatus AliasNotExist = new RequestStatus(11, "AliasNotExist");
|
||||
|
||||
public final static RequestStatus AccountActivated = new RequestStatus(12, "AccountActivated");
|
||||
public final static RequestStatus AccountAlreadyActivated = new RequestStatus(13, "AccountAlreadyActivated");
|
||||
public final static RequestStatus AccountNotActivated = new RequestStatus(14, "AccountNotActivated");
|
||||
|
||||
public final static RequestStatus AccountLinked = new RequestStatus(15, "AccountLinked");
|
||||
public final static RequestStatus AccountNotLinked = new RequestStatus(16, "AccountNotLinked");
|
||||
|
||||
public final static RequestStatus ErrorServer = new RequestStatus(17, "ErrorServer");
|
||||
|
||||
private RequestStatus(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
|
||||
public static RequestStatus fromInt(int value) {
|
||||
for (int i=0; i < values.size(); i++) {
|
||||
RequestStatus state = (RequestStatus) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("RequestStatus not found [" + value + "]");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
@ -98,67 +293,53 @@ public interface LinphoneAccountCreator {
|
|||
|
||||
void setListener(LinphoneAccountCreatorListener listener);
|
||||
|
||||
Status setUsername(String username);
|
||||
UsernameCheck setUsername(String username);
|
||||
|
||||
String getUsername();
|
||||
|
||||
Status setPhoneNumber(String phoneNumber, String countryCode);
|
||||
int setPhoneNumber(String phoneNumber, String countryCode);
|
||||
|
||||
String getPhoneNumber();
|
||||
|
||||
Status setPassword(String password);
|
||||
PasswordCheck setPassword(String password);
|
||||
|
||||
String getPassword();
|
||||
|
||||
Status setHa1(String ha1);
|
||||
PasswordCheck setHa1(String ha1);
|
||||
|
||||
String getHa1();
|
||||
|
||||
Status setActivationCode(String activationCode);
|
||||
ActivationCodeCheck setActivationCode(String activationCode);
|
||||
|
||||
Status setLanguage(String lang);
|
||||
LanguageCheck setLanguage(String lang);
|
||||
|
||||
Status setTransport(TransportType transport);
|
||||
|
||||
TransportType getTransport();
|
||||
|
||||
Status setDomain(String domain);
|
||||
|
||||
String getDomain();
|
||||
|
||||
Status setRoute(String route);
|
||||
|
||||
String getRoute();
|
||||
|
||||
Status setDisplayName(String displayName);
|
||||
UsernameCheck setDisplayName(String displayName);
|
||||
|
||||
String getDisplayName();
|
||||
|
||||
Status setEmail(String email);
|
||||
EmailCheck setEmail(String email);
|
||||
|
||||
String getEmail();
|
||||
|
||||
String getPrefix(String phone);
|
||||
|
||||
Status isAccountUsed();
|
||||
RequestStatus isAccountUsed();
|
||||
|
||||
Status createAccount();
|
||||
RequestStatus createAccount();
|
||||
|
||||
Status activateAccount();
|
||||
RequestStatus activateAccount();
|
||||
|
||||
Status isAccountActivated();
|
||||
RequestStatus isAccountActivated();
|
||||
|
||||
Status linkPhoneNumberWithAccount();
|
||||
RequestStatus linkPhoneNumberWithAccount();
|
||||
|
||||
Status activatePhoneNumberLink();
|
||||
RequestStatus activatePhoneNumberLink();
|
||||
|
||||
Status isAccountLinked();
|
||||
RequestStatus isAccountLinked();
|
||||
|
||||
Status isPhoneNumberUsed();
|
||||
RequestStatus isPhoneNumberUsed();
|
||||
|
||||
Status recoverPhoneAccount();
|
||||
RequestStatus recoverPhoneAccount();
|
||||
|
||||
Status updatePassword(String newPassword);
|
||||
|
||||
LinphoneProxyConfig configure();
|
||||
RequestStatus updatePassword(String newPassword);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneAddress.TransportType;
|
||||
|
||||
public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
||||
protected long nativePtr;
|
||||
|
||||
|
|
@ -48,8 +46,8 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setUsername(long ptr, String username);
|
||||
@Override
|
||||
public Status setUsername(String username) {
|
||||
return Status.fromInt(setUsername(nativePtr, username));
|
||||
public UsernameCheck setUsername(String username) {
|
||||
return UsernameCheck.fromInt(setUsername(nativePtr, username));
|
||||
}
|
||||
|
||||
private native String getUsername(long ptr);
|
||||
|
|
@ -60,8 +58,8 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setPhoneNumber(long ptr, String phoneNumber, String countryCode);
|
||||
@Override
|
||||
public Status setPhoneNumber(String phoneNumber, String countryCode) {
|
||||
return Status.fromInt(setPhoneNumber(nativePtr, phoneNumber, countryCode));
|
||||
public int setPhoneNumber(String phoneNumber, String countryCode) {
|
||||
return setPhoneNumber(nativePtr, phoneNumber, countryCode);
|
||||
}
|
||||
|
||||
private native String getPhoneNumber(long ptr);
|
||||
|
|
@ -72,8 +70,8 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setPassword(long ptr, String password);
|
||||
@Override
|
||||
public Status setPassword(String password) {
|
||||
return Status.fromInt(setPassword(nativePtr, password));
|
||||
public PasswordCheck setPassword(String password) {
|
||||
return PasswordCheck.fromInt(setPassword(nativePtr, password));
|
||||
}
|
||||
|
||||
private native String getPassword(long ptr);
|
||||
|
|
@ -84,8 +82,8 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setHa1(long ptr, String ha1);
|
||||
@Override
|
||||
public Status setHa1(String ha1) {
|
||||
return Status.fromInt(setHa1(nativePtr, ha1));
|
||||
public PasswordCheck setHa1(String ha1) {
|
||||
return PasswordCheck.fromInt(setHa1(nativePtr, ha1));
|
||||
}
|
||||
|
||||
private native String getHa1(long ptr);
|
||||
|
|
@ -96,56 +94,20 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setActivationCode(long ptr, String activationCode);
|
||||
@Override
|
||||
public Status setActivationCode(String activationCode) {
|
||||
return Status.fromInt(setActivationCode(nativePtr, activationCode));
|
||||
public ActivationCodeCheck setActivationCode(String activationCode) {
|
||||
return ActivationCodeCheck.fromInt(setActivationCode(nativePtr, activationCode));
|
||||
}
|
||||
|
||||
private native int setLanguage(long ptr, String lang);
|
||||
@Override
|
||||
public Status setLanguage(String lang) {
|
||||
return Status.fromInt(setLanguage(nativePtr, lang));
|
||||
}
|
||||
|
||||
private native int setTransport(long ptr, int transport);
|
||||
@Override
|
||||
public Status setTransport(TransportType transport) {
|
||||
return Status.fromInt(setTransport(nativePtr, transport.toInt()));
|
||||
}
|
||||
|
||||
private native int getTransport(long ptr);
|
||||
@Override
|
||||
public TransportType getTransport() {
|
||||
return TransportType.fromInt(getTransport(nativePtr));
|
||||
}
|
||||
|
||||
private native int setDomain(long ptr, String domain);
|
||||
@Override
|
||||
public Status setDomain(String domain) {
|
||||
return Status.fromInt(setDomain(nativePtr, domain));
|
||||
}
|
||||
|
||||
private native String getDomain(long ptr);
|
||||
@Override
|
||||
public String getDomain() {
|
||||
return getDomain(nativePtr);
|
||||
}
|
||||
|
||||
private native int setRoute(long ptr, String route);
|
||||
@Override
|
||||
public Status setRoute(String route) {
|
||||
return Status.fromInt(setRoute(nativePtr, route));
|
||||
}
|
||||
|
||||
private native String getRoute(long ptr);
|
||||
@Override
|
||||
public String getRoute() {
|
||||
return getRoute(nativePtr);
|
||||
public LanguageCheck setLanguage(String lang) {
|
||||
return LanguageCheck.fromInt(setLanguage(nativePtr, lang));
|
||||
}
|
||||
|
||||
private native int setDisplayName(long ptr, String displayName);
|
||||
@Override
|
||||
public Status setDisplayName(String displayName) {
|
||||
return Status.fromInt(setDisplayName(nativePtr, displayName));
|
||||
public UsernameCheck setDisplayName(String displayName) {
|
||||
return UsernameCheck.fromInt(setDisplayName(nativePtr, displayName));
|
||||
}
|
||||
|
||||
private native String getDisplayName(long ptr);
|
||||
|
|
@ -156,8 +118,8 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int setEmail(long ptr, String email);
|
||||
@Override
|
||||
public Status setEmail(String email) {
|
||||
return Status.fromInt(setEmail(nativePtr, email));
|
||||
public EmailCheck setEmail(String email) {
|
||||
return EmailCheck.fromInt(setEmail(nativePtr, email));
|
||||
}
|
||||
|
||||
private native String getEmail(long ptr);
|
||||
|
|
@ -174,67 +136,61 @@ public class LinphoneAccountCreatorImpl implements LinphoneAccountCreator {
|
|||
|
||||
private native int isAccountUsed(long ptr);
|
||||
@Override
|
||||
public Status isAccountUsed() {
|
||||
return Status.fromInt(isAccountUsed(nativePtr));
|
||||
public RequestStatus isAccountUsed() {
|
||||
return RequestStatus.fromInt(isAccountUsed(nativePtr));
|
||||
}
|
||||
|
||||
private native int createAccount(long ptr);
|
||||
@Override
|
||||
public Status createAccount() {
|
||||
return Status.fromInt(createAccount(nativePtr));
|
||||
public RequestStatus createAccount() {
|
||||
return RequestStatus.fromInt(createAccount(nativePtr));
|
||||
}
|
||||
|
||||
private native int activateAccount(long ptr);
|
||||
@Override
|
||||
public Status activateAccount() {
|
||||
return Status.fromInt(activateAccount(nativePtr));
|
||||
public RequestStatus activateAccount() {
|
||||
return RequestStatus.fromInt(activateAccount(nativePtr));
|
||||
}
|
||||
|
||||
private native int isAccountLinked(long ptr);
|
||||
@Override
|
||||
public Status isAccountLinked() {
|
||||
return Status.fromInt(isAccountLinked(nativePtr));
|
||||
public RequestStatus isAccountLinked() {
|
||||
return RequestStatus.fromInt(isAccountLinked(nativePtr));
|
||||
}
|
||||
|
||||
private native int isPhoneNumberUsed(long ptr);
|
||||
@Override
|
||||
public Status isPhoneNumberUsed() {
|
||||
return Status.fromInt(isPhoneNumberUsed(nativePtr));
|
||||
public RequestStatus isPhoneNumberUsed() {
|
||||
return RequestStatus.fromInt(isPhoneNumberUsed(nativePtr));
|
||||
}
|
||||
|
||||
private native int isAccountActivated(long ptr);
|
||||
@Override
|
||||
public Status isAccountActivated() {
|
||||
return Status.fromInt(isAccountActivated(nativePtr));
|
||||
public RequestStatus isAccountActivated() {
|
||||
return RequestStatus.fromInt(isAccountActivated(nativePtr));
|
||||
}
|
||||
|
||||
private native int linkPhoneNumberWithAccount(long ptr);
|
||||
@Override
|
||||
public Status linkPhoneNumberWithAccount() {
|
||||
return Status.fromInt(linkPhoneNumberWithAccount(nativePtr));
|
||||
public RequestStatus linkPhoneNumberWithAccount() {
|
||||
return RequestStatus.fromInt(linkPhoneNumberWithAccount(nativePtr));
|
||||
}
|
||||
|
||||
private native int activatePhoneNumberLink(long ptr);
|
||||
@Override
|
||||
public Status activatePhoneNumberLink() {
|
||||
return Status.fromInt(activatePhoneNumberLink(nativePtr));
|
||||
public RequestStatus activatePhoneNumberLink() {
|
||||
return RequestStatus.fromInt(activatePhoneNumberLink(nativePtr));
|
||||
}
|
||||
|
||||
private native int recoverPhoneAccount(long ptr);
|
||||
@Override
|
||||
public Status recoverPhoneAccount() {
|
||||
return Status.fromInt(recoverPhoneAccount(nativePtr));
|
||||
public RequestStatus recoverPhoneAccount() {
|
||||
return RequestStatus.fromInt(recoverPhoneAccount(nativePtr));
|
||||
}
|
||||
|
||||
private native int updatePassword(long ptr, String newPassword);
|
||||
@Override
|
||||
public Status updatePassword(String newPassword) {
|
||||
return Status.fromInt(updatePassword(nativePtr, newPassword));
|
||||
}
|
||||
|
||||
private native LinphoneProxyConfig configure(long ptr);
|
||||
@Override
|
||||
public LinphoneProxyConfig configure() {
|
||||
return configure(nativePtr);
|
||||
public RequestStatus updatePassword(String newPassword) {
|
||||
return RequestStatus.fromInt(updatePassword(nativePtr, newPassword));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue