Update transifex + Add password change button on account pref
This commit is contained in:
parent
4f480ac48a
commit
93db2a58d5
15 changed files with 321 additions and 85 deletions
|
@ -79,14 +79,6 @@
|
|||
<arg value="-c" />
|
||||
<arg value="tail -n 500 ${archive.name}" />
|
||||
</exec>
|
||||
<exec executable="bash">
|
||||
<arg value="-c"/>
|
||||
<arg value="echo ${archive.name}"/>
|
||||
</exec>
|
||||
<exec executable="bash">
|
||||
<arg value="-c"/>
|
||||
<arg value="pwd"/>
|
||||
</exec>
|
||||
<exec executable="bash" >
|
||||
<arg value="-c" />
|
||||
<arg value="cat ${archive.name} |ndk-stack -sym ../libs-debug/${abi}" />
|
||||
|
|
51
res/layout/new_password.xml
Normal file
51
res/layout/new_password.xml
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
style="@style/font5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="20dp"
|
||||
android:text="@string/password" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password1"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:inputType="textPassword"
|
||||
android:hint="@string/password"
|
||||
android:textCursorDrawable="@null"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="20dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/customText"
|
||||
style="@style/font5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="20dp"
|
||||
android:text="@string/confirm_password" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password2"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:inputType="textPassword"
|
||||
android:hint="@string/confirm_password"
|
||||
android:textCursorDrawable="@null"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="20dp"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -48,6 +48,7 @@
|
|||
<string name="decline">Ablehnen</string>
|
||||
<string name="conference">Konferenz</string>
|
||||
<string name="link">Link</string>
|
||||
<string name="link_account_popup">Möchten Sie das Konto %s mit Ihrer Telefonnummer verknüpfen?</string>
|
||||
<string name="maybe_later">Vielleicht später</string>
|
||||
<string name="later">Später</string>
|
||||
<string name="no">Nein</string>
|
||||
|
@ -64,13 +65,23 @@
|
|||
<string name="assistant_continue">Fortsetzen</string>
|
||||
<string name="assistant_activate">Aktivieren Sie Ihr Konto</string>
|
||||
<string name="assistant_finish">Konfiguration fertigstellen</string>
|
||||
<string name="assistant_validate_account_1">Ihr Konto ist erstellt. Bitte überprüfen Sie Ihre E-Mails, um Ihr Konto zu bestätigen.</string>
|
||||
<string name="assistant_validate_account_2">Sobald das gemacht ist, kommen Sie wieder her und klicken auf die Schaltfläche.</string>
|
||||
<string name="assistant_welcome_desc">Dieser Assistent hilft Ihnen beim Konfigurieren und Nutzen Ihres SIP-Kontos.</string>
|
||||
<string name="assistant_linphone_login_desc">Bitte geben Sie Ihren Benutzernamen und Ihr Passwort des Linphone-Kontos ein</string>
|
||||
<string name="assistant_login_desc">Bitte geben Sie Ihren Benutzernamen und Ihr Passwort mit Ihrer SIP-Domäne ein</string>
|
||||
<string name="assistant_remote_provisioning_desc">Bitte geben Sie eine Bereitstellungs-URL an</string>
|
||||
<string name="transport">Transport</string>
|
||||
<string name="assistant_create_account_phone_number_address">Ihre SIP-Adresse ist</string>
|
||||
<string name="assistant_login_linphone">Linphone-Konto verwenden</string>
|
||||
<string name="assistant_login_generic">SIP-Konto verwenden</string>
|
||||
<string name="assistant_remote_provisioning">Fernkonfiguration abrufen</string>
|
||||
<string name="assistant_create_account_part_1">Bitte bestätigen Sie Ihre Landesvorwahl und geben Sie Ihre Telefonnummer ein</string>
|
||||
<string name="assistant_create_account_part_2">Wir haben Ihnen eine SMS mit einem Bestätigungscode an Ihre Telefonnummer gesendet.</string>
|
||||
<string name="assistant_create_account_part_3">Geben Sie bitte den folgenden 4-stelligen Code ein, um Ihre Telefonnummernbestätigung abzuschließen:\n</string>
|
||||
<string name="assistant_create_account_part_email">Bitte geben Sie einen Benutzernamen, eine E-Mail-Adresse und ein Passwort für Ihr Linphone-Konto ein</string>
|
||||
<string name="assistant_display_name_optional">Anzeigename (optional)</string>
|
||||
<string name="assistant_linphone_account">Verwenden Sie Ihr Linphone-Konto</string>
|
||||
<string name="assistant_generic_account">SIP-Konto verwenden</string>
|
||||
<string name="assistant_remote_provisioning_title">Fernkonfiguration abrufen</string>
|
||||
<string name="assistant_fetch_apply">Abrufen und anwenden</string>
|
||||
|
@ -87,6 +98,7 @@
|
|||
<string name="wizard_failed">Es ist ein Fehler aufgetreten, versuchen Sie es später nochmal</string>
|
||||
<string name="wizard_server_unavailable">Server nicht erreichbar, überprüfen Sie Ihre Netzwerkverbindung.</string>
|
||||
<string name="wizard_username_unavailable">Der Benutzername wird bereits verwendet.</string>
|
||||
<string name="assistant_phone_number_unavailable">Diese Telefonnummer wird bereits verwendet.\r\nBitte geben Sie eine andere Nummer ein.\r\nSie können Ihr vorhandenes Konto löschen, wenn Sie Ihre Telefonnummer wiederverwenden möchten.</string>
|
||||
<string name="wizard_username_incorrect">Ihr Benutzername ist ungültig.</string>
|
||||
<string name="assistant_phone_number_incorrect">Ihre Telefonnummer ist ungültig.</string>
|
||||
<string name="wizard_email_incorrect">Ihre E-Mail-Adresse ist ungültig.</string>
|
||||
|
@ -98,7 +110,9 @@
|
|||
<string name="assistant_choose_country">Wählen Sie ein Land aus</string>
|
||||
<string name="select_your_country">Wählen Sie Ihr Land aus</string>
|
||||
<string name="country_code">(%s)</string>
|
||||
<string name="use_username_instead_or_phone_number">Benutzername verwenden (optional)</string>
|
||||
<string name="use_email_for_validation">E-Mail-Adresse für Kontobestätigung verwenden</string>
|
||||
<string name="login_with_username">Verwenden Sie Ihren Benutzernamen und Ihr Passwort anstelle Ihrer Telefonnummer</string>
|
||||
<string name="phone_number_info_title">Wozu wird meine Telefonnummer verwendet?</string>
|
||||
<!--Status-->
|
||||
<string name="invalid_email">Ungültige E-Mail-Adresse</string>
|
||||
|
@ -116,11 +130,14 @@
|
|||
<string name="phone_number_invalid">Ungültige Telefonnummer</string>
|
||||
<string name="password_too_short">Passwort zu kurz</string>
|
||||
<string name="password_too_long">Passwort zu lang</string>
|
||||
<string name="request_failed">Fehler beim Abfragen des Servers. Bitte versuchen Sie es später erneut</string>
|
||||
<string name="transport_unsupported">Nicht unterstützter Transport</string>
|
||||
<string name="country_code_invalid">Landesvorwahl ungültig</string>
|
||||
<!--In-app-->
|
||||
<string name="inapp">In-App</string>
|
||||
<string name="inapp_notification_title">In-App-Kauf</string>
|
||||
<string name="inapp_notification_trial_expire">Die Probezeit läuft am %s ab</string>
|
||||
<string name="inapp_notification_account_expire">Die Bezugszeit läuft am %s ab</string>
|
||||
<!--Dailer-->
|
||||
<string name="address_bar_hint">Geben Sie eine Nummer oder eine Adresse ein</string>
|
||||
<!--History-->
|
||||
|
@ -177,7 +194,7 @@
|
|||
<string name="call_stats_audio">Audio</string>
|
||||
<string name="call_stats_video">Video</string>
|
||||
<string name="call_stats_codec">Codec:</string>
|
||||
<string name="call_stats_ip">Afinet:</string>
|
||||
<string name="call_stats_ip">IP-Familie:</string>
|
||||
<string name="call_stats_upload">Upload-Bandbreite:</string>
|
||||
<string name="call_stats_download">Download-Bandbreite:</string>
|
||||
<string name="call_stats_ice">ICE-Konnektivität:</string>
|
||||
|
@ -247,11 +264,13 @@
|
|||
<string name="pref_transport_tcp">TCP</string>
|
||||
<string name="pref_transport_tls">TLS</string>
|
||||
<string name="pref_delete_account">Konto löschen</string>
|
||||
<string name="pref_change_password">Passwort ändern</string>
|
||||
<string name="pref_default_account">Als Standard benutzen</string>
|
||||
<!--Settings-->
|
||||
<string name="pref_sipaccounts">SIP-Konten</string>
|
||||
<string name="default_account_flag">Standardkonto</string>
|
||||
<string name="pref_add_account">Konto hinzufügen</string>
|
||||
<string name="pref_in_app_store">In-App Store</string>
|
||||
<string name="pref_tunnel">Tunnel</string>
|
||||
<string name="pref_tunnel_host">Hostname</string>
|
||||
<string name="pref_tunnel_port">Port</string>
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<string name="decline">Refuser</string>
|
||||
<string name="conference">Conférence</string>
|
||||
<string name="link">Associer</string>
|
||||
<string name="link_account_popup">Voulez vous associer le compte %s avec votre numéro de téléphone ?</string>
|
||||
<string name="maybe_later">Plus tard</string>
|
||||
<string name="later">Plus tard</string>
|
||||
<string name="no">Non</string>
|
||||
|
@ -136,6 +137,10 @@ Vos amis pourront vous joindre plus facilement si vous associez votre compte à
|
|||
<string name="transport_unsupported">Transport non supporté</string>
|
||||
<string name="country_code_invalid">Indicatif de pays non valide</string>
|
||||
<!--In-app-->
|
||||
<string name="inapp">In-app</string>
|
||||
<string name="inapp_notification_title">Achat In-app</string>
|
||||
<string name="inapp_notification_trial_expire">La période d\'essai se terminera le %s</string>
|
||||
<string name="inapp_notification_account_expire">L\'abonnement se terminera le %s</string>
|
||||
<!--Dailer-->
|
||||
<string name="address_bar_hint">Entrez un numéro ou une adresse</string>
|
||||
<!--History-->
|
||||
|
@ -192,9 +197,12 @@ Vos amis pourront vous joindre plus facilement si vous associez votre compte à
|
|||
<string name="call_stats_audio">Audio</string>
|
||||
<string name="call_stats_video">Vidéo</string>
|
||||
<string name="call_stats_codec">Codec :</string>
|
||||
<string name="call_stats_ip">Type d\'IP :</string>
|
||||
<string name="call_stats_upload">Bande passante envoi :</string>
|
||||
<string name="call_stats_download">Bande passante réception :</string>
|
||||
<string name="call_stats_ice">Connexion ICE :</string>
|
||||
<string name="call_stats_video_resolution_sent">Résolution vidéo envoyée</string>
|
||||
<string name="call_stats_video_resolution_received">Résolution vidéo reçu</string>
|
||||
<string name="call_stats_encoder_name">Encodeur :</string>
|
||||
<string name="call_stats_decoder_name">Décodeur :</string>
|
||||
<string name="call">Appel</string>
|
||||
|
@ -257,7 +265,9 @@ Vos amis pourront vous joindre plus facilement si vous associez votre compte à
|
|||
<string name="pref_transport_tcp">TCP</string>
|
||||
<string name="pref_transport_tls">TLS</string>
|
||||
<string name="pref_delete_account">Supprimer ce compte</string>
|
||||
<string name="pref_change_password">Changer de mot de passe</string>
|
||||
<string name="pref_default_account">Utiliser par défaut</string>
|
||||
<string name="pref_password_changed">Mot de passe changé</string>
|
||||
<!--Settings-->
|
||||
<string name="pref_sipaccounts">Comptes SIP</string>
|
||||
<string name="default_account_flag">Compte par défaut</string>
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
<string name="call_stats_audio">Audio</string>
|
||||
<string name="call_stats_video">Video</string>
|
||||
<string name="call_stats_codec">Codec:</string>
|
||||
<string name="call_stats_ip">Afinet:</string>
|
||||
<string name="call_stats_ip">IP Family:</string>
|
||||
<string name="call_stats_upload">Upload bandwidth:</string>
|
||||
<string name="call_stats_download">Download bandwidth:</string>
|
||||
<string name="call_stats_ice">ICE connectivity:</string>
|
||||
|
@ -284,7 +284,9 @@
|
|||
<string name="pref_transport_tcp">TCP</string>
|
||||
<string name="pref_transport_tls">TLS</string>
|
||||
<string name="pref_delete_account">Delete this account</string>
|
||||
<string name="pref_change_password">Change password</string>
|
||||
<string name="pref_default_account">Use as default</string>
|
||||
<string name="pref_password_changed">Password changed</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="pref_sipaccounts">SIP Accounts</string>
|
||||
|
|
|
@ -5,68 +5,68 @@
|
|||
android:title="@string/pref_sipaccount"
|
||||
android:key="@string/pref_sipaccount_key"
|
||||
android:persistent="false">
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_username"
|
||||
android:inputType="text|textNoSuggestions"
|
||||
android:dialogMessage="@string/pref_help_username"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_auth_userid"
|
||||
android:inputType="text|textNoSuggestions"
|
||||
android:dialogMessage="@string/pref_help_auth_userid"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_passwd"
|
||||
android:dialogMessage="@string/pref_help_password"
|
||||
android:inputType="textPassword"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_domain"
|
||||
android:dialogMessage="@string/pref_help_domain"
|
||||
android:inputType="textUri"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_display_name"
|
||||
android:inputType="textPersonName"
|
||||
android:dialogMessage="@string/pref_help_display_name"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_advanced_title"
|
||||
android:key="@string/pref_advanced_key"
|
||||
android:persistent="false">
|
||||
|
||||
<ListPreference
|
||||
|
||||
<ListPreference
|
||||
android:title="@string/pref_transport"
|
||||
android:key="@string/pref_transport_key"
|
||||
android:persistent="false"/>
|
||||
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_proxy"
|
||||
android:inputType="textUri"
|
||||
android:summary="@string/pref_help_proxy"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="@string/pref_enable_outbound_proxy"
|
||||
android:dialogMessage="@string/pref_help_outbound_proxy"
|
||||
android:summary="@string/pref_help_outbound_proxy"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_expire_title"
|
||||
android:key="@string/pref_expire_key"
|
||||
android:numeric="integer"
|
||||
android:numeric="integer"
|
||||
android:persistent="false"/>
|
||||
|
||||
<EditTextPreference
|
||||
|
||||
<EditTextPreference
|
||||
android:title="@string/pref_prefix"
|
||||
android:key="@string/pref_prefix_key"
|
||||
android:persistent="false"/>
|
||||
|
@ -82,7 +82,7 @@
|
|||
android:numeric="integer"
|
||||
android:persistent="false"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<CheckBoxPreference
|
||||
android:title="@string/pref_escape_plus"
|
||||
android:key="@string/pref_escape_plus_key"
|
||||
android:persistent="false"/>
|
||||
|
@ -96,26 +96,30 @@
|
|||
android:title="@string/pref_link_account"
|
||||
android:key="@string/pref_link_account_key"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_manage_title"
|
||||
android:key="@string/pref_manage_key"
|
||||
android:persistent="false">
|
||||
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="@string/pref_disable_account"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="@string/pref_default_account"
|
||||
android:persistent="false"/>
|
||||
|
||||
<Preference
|
||||
|
||||
<Preference
|
||||
android:title="@string/pref_change_password"
|
||||
android:persistent="false"/>
|
||||
|
||||
<Preference
|
||||
android:title="@string/pref_delete_account"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
|
@ -23,11 +23,18 @@ import java.util.List;
|
|||
|
||||
import org.linphone.LinphonePreferences.AccountBuilder;
|
||||
import org.linphone.assistant.AssistantActivity;
|
||||
import org.linphone.core.LinphoneAccountCreator;
|
||||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.PreferencesListFragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.EditTextPreference;
|
||||
|
@ -37,18 +44,24 @@ import android.preference.Preference.OnPreferenceChangeListener;
|
|||
import android.preference.Preference.OnPreferenceClickListener;
|
||||
import android.preference.PreferenceCategory;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class AccountPreferencesFragment extends PreferencesListFragment {
|
||||
public class AccountPreferencesFragment extends PreferencesListFragment implements LinphoneAccountCreator.LinphoneAccountCreatorListener {
|
||||
private int n;
|
||||
private boolean isNewAccount=false;
|
||||
private LinphonePreferences mPrefs;
|
||||
private EditTextPreference mProxyPreference;
|
||||
private ListPreference mTransportPreference;
|
||||
private AccountBuilder builder;
|
||||
private LinphoneAccountCreator accountCreator;
|
||||
private ProgressDialog progress;
|
||||
|
||||
public AccountPreferencesFragment() {
|
||||
super(R.xml.account_preferences);
|
||||
|
@ -289,6 +302,10 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
private void initAccountPreferencesFields(PreferenceScreen parent) {
|
||||
boolean isDefaultAccount = mPrefs.getDefaultAccountIndex() == n;
|
||||
|
||||
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc()
|
||||
, LinphonePreferences.instance().getXmlrpcUrl());
|
||||
accountCreator.setListener(this);
|
||||
|
||||
PreferenceCategory account = (PreferenceCategory) getPreferenceScreen().findPreference(getString(R.string.pref_sipaccount_key));
|
||||
EditTextPreference username = (EditTextPreference) account.getPreference(0);
|
||||
username.setOnPreferenceChangeListener(usernameChangedListener);
|
||||
|
@ -387,8 +404,8 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
Preference linkAccount = advanced.getPreference(9);
|
||||
linkAccount.setOnPreferenceClickListener(linkAccountListener);
|
||||
|
||||
PreferenceCategory manage = (PreferenceCategory) getPreferenceScreen().findPreference(getString(R.string.pref_manage_key));
|
||||
final CheckBoxPreference disable = (CheckBoxPreference) manage.getPreference(0);
|
||||
PreferenceCategory manage = (PreferenceCategory) getPreferenceScreen().findPreference(getString(R.string.pref_manage_key));
|
||||
final CheckBoxPreference disable = (CheckBoxPreference) manage.getPreference(0);
|
||||
disable.setEnabled(true);
|
||||
disable.setOnPreferenceChangeListener(disableChangedListener);
|
||||
if(!isNewAccount){
|
||||
|
@ -396,10 +413,9 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
}
|
||||
|
||||
CheckBoxPreference mainAccount = (CheckBoxPreference) manage.getPreference(1);
|
||||
mainAccount.setChecked(isDefaultAccount);
|
||||
mainAccount.setEnabled(!mainAccount.isChecked());
|
||||
mainAccount.setOnPreferenceClickListener(new OnPreferenceClickListener()
|
||||
{
|
||||
mainAccount.setChecked(isDefaultAccount);
|
||||
mainAccount.setEnabled(!mainAccount.isChecked());
|
||||
mainAccount.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
mPrefs.setDefaultAccount(n);
|
||||
disable.setEnabled(false);
|
||||
|
@ -412,7 +428,63 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
mainAccount.setEnabled(!mainAccount.isChecked());
|
||||
}
|
||||
|
||||
final Preference delete = manage.getPreference(2);
|
||||
final Preference changePassword = manage.getPreference(2);
|
||||
if (mPrefs.getAccountDomain(n).compareTo(getString(R.string.default_domain)) == 0) {
|
||||
changePassword.setEnabled(!isNewAccount);
|
||||
changePassword.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
final AlertDialog.Builder alert = new AlertDialog.Builder(LinphoneActivity.instance());
|
||||
LayoutInflater inflater = LinphoneActivity.instance().getLayoutInflater();
|
||||
View layout = inflater.inflate(R.layout.new_password, null);
|
||||
final EditText pass1 = (EditText) layout.findViewById(R.id.password1);
|
||||
final EditText pass2 = (EditText) layout.findViewById(R.id.password2);
|
||||
alert.setNeutralButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
LinphoneAccountCreator.Status status = accountCreator.setPassword(pass1.getText().toString());
|
||||
if (status.equals(LinphoneAccountCreator.Status.Ok)) {
|
||||
if (pass1.getText().toString().compareTo(pass2.getText().toString()) == 0) {
|
||||
accountCreator.setUsername(mPrefs.getAccountUsername(n));
|
||||
accountCreator.setHa1(mPrefs.getAccountHa1(n));
|
||||
status = accountCreator.updatePassword(pass1.getText().toString());
|
||||
if (!status.equals(LinphoneAccountCreator.Status.Ok)) {
|
||||
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(status)
|
||||
, LinphoneActivity.instance());
|
||||
} else {
|
||||
progress = ProgressDialog.show(LinphoneActivity.instance(), null, null);
|
||||
Drawable d = new ColorDrawable(ContextCompat.getColor(LinphoneActivity.instance(), R.color.colorE));
|
||||
d.setAlpha(200);
|
||||
progress.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||
progress.getWindow().setBackgroundDrawable(d);
|
||||
progress.setContentView(R.layout.progress_dialog);
|
||||
progress.show();
|
||||
}
|
||||
} else {
|
||||
LinphoneUtils.displayErrorAlert(getString(R.string.wizard_passwords_unmatched)
|
||||
, LinphoneActivity.instance());
|
||||
}
|
||||
return;
|
||||
}
|
||||
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(status), LinphoneActivity.instance());
|
||||
}
|
||||
});
|
||||
|
||||
alert.setView(layout);
|
||||
alert.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
changePassword.setEnabled(false);
|
||||
}
|
||||
|
||||
final Preference delete = manage.getPreference(3);
|
||||
delete.setEnabled(!isNewAccount);
|
||||
delete.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
|
@ -484,4 +556,60 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
LinphoneActivity.instance().hideTopBar();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorAccountLinkedWithPhoneNumber(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPhoneNumberLinkActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
progress.dismiss();
|
||||
if (status.equals(LinphoneAccountCreator.Status.Ok)) {
|
||||
mPrefs.setAccountPassword(n, accountCreator.getPassword());
|
||||
PreferenceCategory account = (PreferenceCategory) getPreferenceScreen().findPreference(getString(R.string.pref_sipaccount_key));
|
||||
((EditTextPreference) account.getPreference(2)).setText(mPrefs.getAccountPassword(n));
|
||||
LinphoneUtils.displayErrorAlert(getString(R.string.pref_password_changed), LinphoneActivity.instance());
|
||||
} else {
|
||||
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(status), LinphoneActivity.instance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1449,8 +1449,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
public void isAccountWithAlias(){
|
||||
if(LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||
accountCreator.isAccountUsed();
|
||||
long now = Calendar.getInstance().getTimeInMillis();
|
||||
if (LinphonePreferences.instance().getLinkPopupTime() == null
|
||||
|| Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) > now) {
|
||||
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
|
||||
accountCreator.isAccountUsed();
|
||||
}
|
||||
} else {
|
||||
LinphonePreferences.instance().setLinkPopupTime(null);
|
||||
}
|
||||
|
@ -1459,11 +1463,9 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
private void askLinkWithPhoneNumber(){
|
||||
long now = Calendar.getInstance().getTimeInMillis();
|
||||
long newDate = now + (LinphoneActivity.instance().getResources().getInteger(R.integer.popup_time_interval)*60);
|
||||
if (LinphonePreferences.instance().getLinkPopupTime() != null && Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) > now) {
|
||||
return;
|
||||
} else {
|
||||
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
|
||||
}
|
||||
|
||||
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
|
||||
|
||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(String.format(getString(R.string.link_account_popup), LinphoneManager.getLc().getDefaultProxyConfig().getAddress().asStringUriOnly()));
|
||||
Button delete = (Button) dialog.findViewById(R.id.delete_button);
|
||||
delete.setText(getString(R.string.link));
|
||||
|
@ -1657,4 +1659,9 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
@Override
|
||||
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -779,7 +779,7 @@ public class LinphonePreferences {
|
|||
if (authInfo != null) {
|
||||
getLc().removeAuthInfo(authInfo);
|
||||
}
|
||||
|
||||
|
||||
LinphoneProxyConfig proxyCfg = getProxyConfig(n);
|
||||
if (proxyCfg != null)
|
||||
getLc().removeProxyConfig(proxyCfg);
|
||||
|
@ -788,7 +788,7 @@ public class LinphonePreferences {
|
|||
} else {
|
||||
getLc().setDefaultProxyConfig(null);
|
||||
}
|
||||
|
||||
|
||||
getLc().refreshRegisters();
|
||||
}
|
||||
// End of accounts settings
|
||||
|
@ -976,7 +976,7 @@ public class LinphonePreferences {
|
|||
transports.tls = LINPHONE_CORE_RANDOM_PORT;
|
||||
getLc().setSignalingTransportPorts(transports);
|
||||
}
|
||||
|
||||
|
||||
private LinphoneNatPolicy getOrCreateNatPolicy() {
|
||||
LinphoneNatPolicy nat = getLc().getNatPolicy();
|
||||
if (nat == null) {
|
||||
|
@ -991,9 +991,9 @@ public class LinphonePreferences {
|
|||
}
|
||||
|
||||
public void setStunServer(String stun) {
|
||||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
nat.setStunServer(stun);
|
||||
|
||||
|
||||
if (stun != null && !stun.isEmpty()) {
|
||||
nat.enableStun(true);
|
||||
}
|
||||
|
@ -1032,16 +1032,16 @@ public class LinphonePreferences {
|
|||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
return nat.turnEnabled();
|
||||
}
|
||||
|
||||
|
||||
public String getTurnUsername() {
|
||||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
return nat.getStunServerUsername();
|
||||
}
|
||||
|
||||
|
||||
public void setTurnUsername(String username) {
|
||||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
LinphoneAuthInfo authInfo = getLc().findAuthInfo(nat.getStunServerUsername(), null, null);
|
||||
|
||||
|
||||
if (authInfo != null) {
|
||||
LinphoneAuthInfo cloneAuthInfo = authInfo.clone();
|
||||
getLc().removeAuthInfo(authInfo);
|
||||
|
@ -1055,11 +1055,11 @@ public class LinphonePreferences {
|
|||
nat.setStunServerUsername(username);
|
||||
getLc().setNatPolicy(nat);
|
||||
}
|
||||
|
||||
|
||||
public void setTurnPassword(String password) {
|
||||
LinphoneNatPolicy nat = getOrCreateNatPolicy();
|
||||
LinphoneAuthInfo authInfo = getLc().findAuthInfo(nat.getStunServerUsername(), null, null);
|
||||
|
||||
|
||||
if (authInfo != null) {
|
||||
LinphoneAuthInfo cloneAuthInfo = authInfo.clone();
|
||||
getLc().removeAuthInfo(authInfo);
|
||||
|
@ -1084,7 +1084,7 @@ public class LinphonePreferences {
|
|||
|
||||
public void setPushNotificationEnabled(boolean enable) {
|
||||
getConfig().setBool("app", "push_notification", enable);
|
||||
|
||||
|
||||
LinphoneCore lc = getLc();
|
||||
if (lc == null) {
|
||||
return;
|
||||
|
@ -1316,31 +1316,31 @@ public class LinphonePreferences {
|
|||
public boolean isContactsMigrationDone(){
|
||||
return getConfig().getBool("app", "contacts_migration_done", false);
|
||||
}
|
||||
|
||||
|
||||
public String getInAppPurchaseValidatingServerUrl() {
|
||||
return getConfig().getString("in-app-purchase", "server_url", null);
|
||||
}
|
||||
|
||||
|
||||
public Purchasable getInAppPurchasedItem() {
|
||||
String id = getConfig().getString("in-app-purchase", "purchase_item_id", null);
|
||||
String payload = getConfig().getString("in-app-purchase", "purchase_item_payload", null);
|
||||
String signature = getConfig().getString("in-app-purchase", "purchase_item_signature", null);
|
||||
String username = getConfig().getString("in-app-purchase", "purchase_item_username", null);
|
||||
|
||||
|
||||
Purchasable item = new Purchasable(id).setPayloadAndSignature(payload, signature).setUserData(username);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
public void setInAppPurchasedItem(Purchasable item) {
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
|
||||
getConfig().setString("in-app-purchase", "purchase_item_id", item.getId());
|
||||
getConfig().setString("in-app-purchase", "purchase_item_payload", item.getPayload());
|
||||
getConfig().setString("in-app-purchase", "purchase_item_signature", item.getPayloadSignature());
|
||||
getConfig().setString("in-app-purchase", "purchase_item_username", item.getUserData());
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<String> getInAppPurchasables() {
|
||||
ArrayList<String> purchasables = new ArrayList<String>();
|
||||
String list = getConfig().getString("in-app-purchase", "purchasable_items_ids", null);
|
||||
|
@ -1401,19 +1401,19 @@ public class LinphonePreferences {
|
|||
public void setServiceNotificationVisibility(boolean enable) {
|
||||
getConfig().setBool("app", "show_service_notification", enable);
|
||||
}
|
||||
|
||||
|
||||
public boolean isOverlayEnabled() {
|
||||
return getConfig().getBool("app", "display_overlay", false);
|
||||
}
|
||||
|
||||
|
||||
public void enableOverlay(boolean enable) {
|
||||
getConfig().setBool("app", "display_overlay", enable);
|
||||
}
|
||||
|
||||
|
||||
public LinphoneLimeState getLimeEncryption() {
|
||||
return getLc().getLimeEncryption();
|
||||
}
|
||||
|
||||
|
||||
public void setLimeEncryption(LinphoneLimeState lime) {
|
||||
getLc().setLimeEncryption(lime);
|
||||
}
|
||||
|
@ -1429,16 +1429,16 @@ public class LinphonePreferences {
|
|||
}
|
||||
return firstTime;
|
||||
}
|
||||
|
||||
|
||||
public void permissionHasBeenAsked(String permission) {
|
||||
getConfig().setBool("app", permission, false);
|
||||
}
|
||||
|
||||
|
||||
public boolean isDeviceRingtoneEnabled() {
|
||||
int readExternalStorage = mContext.getPackageManager().checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE, mContext.getPackageName());
|
||||
return getConfig().getBool("app", "device_ringtone", true) && readExternalStorage == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
|
||||
public void enableDeviceRingtone(boolean enable) {
|
||||
getConfig().setBool("app", "device_ringtone", enable);
|
||||
}
|
||||
|
@ -1446,7 +1446,7 @@ public class LinphonePreferences {
|
|||
public boolean isBisFeatureEnabled() {
|
||||
return getConfig().getBool("app", "bis_feature", true);
|
||||
}
|
||||
|
||||
|
||||
public void enableBisFeature(boolean enable) {
|
||||
getConfig().setBool("app", "bis_feature", enable);
|
||||
}
|
||||
|
@ -1454,7 +1454,7 @@ public class LinphonePreferences {
|
|||
public boolean isAutoAnswerEnabled() {
|
||||
return getConfig().getBool("app", "auto_answer", false);
|
||||
}
|
||||
|
||||
|
||||
public void enableAutoAnswer(boolean enable) {
|
||||
getConfig().setBool("app", "auto_answer", enable);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,6 @@ import android.view.View.OnClickListener;
|
|||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -702,6 +700,11 @@ private static AssistantActivity instance;
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
|
||||
public CountryListAdapter getCountryListAdapter() {
|
||||
return countryListAdapter;
|
||||
}
|
||||
|
|
|
@ -122,4 +122,9 @@ public class CreateAccountActivationFragment extends Fragment implements OnClick
|
|||
@Override
|
||||
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,4 +197,9 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
|||
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, Status status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, Status status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -692,4 +692,9 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
|||
accountCreator.isAccountActivated();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, Status status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,4 +371,9 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
|
|||
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(status), AssistantActivity.instance());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccountCreatorPasswordUpdated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3bc59a20c78efc9705db715b4e72cc921e54c835
|
||||
Subproject commit a988e996ca9df932737ee2fe3000ec10f5865f7a
|
Loading…
Reference in a new issue