Fixes and improvements of SettingsFragment

This commit is contained in:
Sylvain Berfini 2016-07-20 17:08:29 +02:00
parent 1790426ba7
commit 90aacc2b5e
5 changed files with 314 additions and 261 deletions

View file

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- DO NOT PUT A PreferenceCategory INSIDE ANOTHER ONE EVER ! -->
<!-- It will trigger [PreferencesListFragment] addPreferencesFromResource TargetInvocationException error -->
<PreferenceCategory
android:title="@string/pref_sipaccounts"
android:key="@string/pref_sipaccounts_key"
@ -16,65 +19,70 @@
android:key="@string/pref_in_app_store_key"
android:persistent="false"/>
<PreferenceCategory
android:title="@string/pref_tunnel"
android:key="@string/pref_tunnel_key"
android:persistent="false">
<EditTextPreference
android:title="@string/pref_tunnel_host"
android:key="@string/pref_tunnel_host_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_tunnel_port"
android:key="@string/pref_tunnel_port_key"
android:numeric="integer"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_tunnel_mode"
android:key="@string/pref_tunnel_mode_key"
android:entries="@array/tunnel_mode_entries"
android:entryValues="@array/tunnel_mode_entry_values"
android:persistent="false"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_preferences_title">
<CheckBoxPreference
android:title="@string/pref_video_enable_title"
android:key="@string/pref_video_enable_key"
android:persistent="false"/>
<PreferenceScreen
android:title="@string/pref_tunnel"
android:key="@string/pref_tunnel_key"
android:persistent="false">
<PreferenceCategory
android:title="@string/pref_tunnel">
<EditTextPreference
android:title="@string/pref_tunnel_host"
android:key="@string/pref_tunnel_host_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_tunnel_port"
android:key="@string/pref_tunnel_port_key"
android:numeric="integer"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_tunnel_mode"
android:key="@string/pref_tunnel_mode_key"
android:entries="@array/tunnel_mode_entries"
android:entryValues="@array/tunnel_mode_entry_values"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/pref_audio_title">
<PreferenceCategory
android:title="@string/pref_audio_title">
<CheckBoxPreference
android:title="@string/pref_echo_cancellation"
android:key="@string/pref_echo_cancellation_key"
android:summary="@string/pref_echo_cancellation_summary"
android:persistent="false"/>
<Preference
android:title="@string/pref_echo_canceller_calibration"
android:key="@string/pref_echo_canceller_calibration_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_adaptive_rate_control"
android:key="@string/pref_adaptive_rate_control_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_codec_bitrate_limit"
android:key="@string/pref_codec_bitrate_limit_key"
android:entries="@array/limit_bitrate_entries"
android:entryValues="@array/limit_bitrate_entry_values"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_echo_cancellation"
android:key="@string/pref_echo_cancellation_key"
android:summary="@string/pref_echo_cancellation_summary"
android:persistent="false"/>
<Preference
android:title="@string/pref_echo_canceller_calibration"
android:key="@string/pref_echo_canceller_calibration_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_adaptive_rate_control"
android:key="@string/pref_adaptive_rate_control_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_codec_bitrate_limit"
android:key="@string/pref_codec_bitrate_limit_key"
android:entries="@array/limit_bitrate_entries"
android:entryValues="@array/limit_bitrate_entry_values"
android:persistent="false"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_codecs"
android:key="@string/pref_codecs_key"
@ -85,60 +93,78 @@
<PreferenceScreen
android:title="@string/pref_video_title"
android:key="@string/pref_video_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:persistent="false">
<CheckBoxPreference
android:title="@string/pref_video_use_front_camera_title"
android:key="@string/pref_video_use_front_camera_key"
android:dependency="@string/pref_video_enable_key"
android:layout="@layout/hidden"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_video_initiate_call_with_video_title"
android:key="@string/pref_video_initiate_call_with_video_key"
android:summary="@string/pref_video_initiate_call_with_video"
android:dependency="@string/pref_video_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_video_automatically_accept_video_title"
android:key="@string/pref_video_automatically_accept_video_key"
android:summary="@string/pref_video_automatically_accept_video"
android:dependency="@string/pref_video_enable_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_video_preset"
android:key="@string/pref_video_preset_key"
android:entries="@array/video_preset_entries"
android:entryValues="@array/video_preset_entries"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_preferred_video_size"
android:key="@string/pref_preferred_video_size_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_preferred_fps"
android:key="@string/pref_preferred_video_fps_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_bandwidth_limit"
android:key="@string/pref_bandwidth_limit_key"
android:numeric="integer"
android:persistent="false"/>
android:persistent="false">
<CheckBoxPreference
android:title="@string/pref_overlay"
android:key="@string/pref_overlay_key"
android:summary="@string/pref_overlay_summary"
android:persistent="false"/>
<PreferenceCategory
android:title="@string/pref_video_title">
<CheckBoxPreference
android:title="@string/pref_video_enable_title"
android:key="@string/pref_video_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_video_use_front_camera_title"
android:key="@string/pref_video_use_front_camera_key"
android:dependency="@string/pref_video_enable_key"
android:layout="@layout/hidden"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_video_initiate_call_with_video_title"
android:key="@string/pref_video_initiate_call_with_video_key"
android:summary="@string/pref_video_initiate_call_with_video"
android:dependency="@string/pref_video_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_video_automatically_accept_video_title"
android:key="@string/pref_video_automatically_accept_video_key"
android:summary="@string/pref_video_automatically_accept_video"
android:dependency="@string/pref_video_enable_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_video_preset"
android:key="@string/pref_video_preset_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:entries="@array/video_preset_entries"
android:entryValues="@array/video_preset_entries"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_preferred_video_size"
android:key="@string/pref_preferred_video_size_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_preferred_fps"
android:key="@string/pref_preferred_video_fps_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_bandwidth_limit"
android:key="@string/pref_bandwidth_limit_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:numeric="integer"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_overlay"
android:key="@string/pref_overlay_key"
android:dependency="@string/pref_video_enable_key"
android:shouldDisableView="true"
android:summary="@string/pref_overlay_summary"
android:persistent="false"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_video_codecs_title"
android:key="@string/pref_video_codecs_key"
@ -150,154 +176,174 @@
<PreferenceScreen
android:title="@string/pref_call_title">
<PreferenceCategory
android:title="@string/pref_call_title">
<CheckBoxPreference
android:title="@string/pref_device_ringtone"
android:key="@string/pref_device_ringtone_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_media_encryption"
android:key="@string/pref_media_encryption_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_sipinfo_dtmf"
android:key="@string/pref_sipinfo_dtmf_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_rfc2833_dtmf"
android:key="@string/pref_rfc2833_dtmf_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_auto_answer"
android:key="@string/pref_auto_answer_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_voice_mail"
android:key="@string/pref_voice_mail_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_device_ringtone"
android:key="@string/pref_device_ringtone_key"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_media_encryption"
android:key="@string/pref_media_encryption_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_sipinfo_dtmf"
android:key="@string/pref_sipinfo_dtmf_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_rfc2833_dtmf"
android:key="@string/pref_rfc2833_dtmf_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_auto_answer"
android:key="@string/pref_auto_answer_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_voice_mail"
android:key="@string/pref_voice_mail_key"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/pref_chat_title">
<PreferenceCategory
android:title="@string/pref_chat_title">
<ListPreference
android:title="@string/pref_use_lime_encryption"
android:key="@string/pref_use_lime_encryption_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_image_sharing_server_title"
android:key="@string/pref_image_sharing_server_key"
android:summary="@string/pref_image_sharing_server_desc"
android:persistent="false"/>
<ListPreference
android:title="@string/pref_use_lime_encryption"
android:key="@string/pref_use_lime_encryption_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_image_sharing_server_title"
android:key="@string/pref_image_sharing_server_key"
android:summary="@string/pref_image_sharing_server_desc"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/pref_network_title">
<PreferenceCategory
android:title="@string/pref_network_title">
<CheckBoxPreference
android:title="@string/pref_wifi_only"
android:key="@string/pref_wifi_only_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_stun_server"
android:key="@string/pref_stun_server_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_ice_enable"
android:key="@string/pref_ice_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_upnp_enable"
android:key="@string/pref_upnp_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_transport_use_random_ports"
android:key="@string/pref_transport_use_random_ports_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_sip_port_title"
android:key="@string/pref_sip_port_key"
android:numeric="integer"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_audio_port_title"
android:key="@string/pref_audio_port_key"
android:summary="@string/pref_audio_port_description"
android:layout="@layout/hidden"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_video_port_title"
android:key="@string/pref_video_port_key"
android:summary="@string/pref_video_port_description"
android:layout="@layout/hidden"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_push_notification"
android:key="@string/pref_push_notification_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_ipv6_title"
android:key="@string/pref_ipv6_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_wifi_only"
android:key="@string/pref_wifi_only_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_stun_server"
android:key="@string/pref_stun_server_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_ice_enable"
android:key="@string/pref_ice_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_upnp_enable"
android:key="@string/pref_upnp_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_transport_use_random_ports"
android:key="@string/pref_transport_use_random_ports_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_sip_port_title"
android:key="@string/pref_sip_port_key"
android:numeric="integer"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_audio_port_title"
android:key="@string/pref_audio_port_key"
android:summary="@string/pref_audio_port_description"
android:layout="@layout/hidden"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_video_port_title"
android:key="@string/pref_video_port_key"
android:summary="@string/pref_video_port_description"
android:layout="@layout/hidden"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_push_notification"
android:key="@string/pref_push_notification_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_ipv6_title"
android:key="@string/pref_ipv6_key"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/pref_advanced_title">
<PreferenceCategory
android:title="@string/pref_advanced_title">
<CheckBoxPreference
android:title="@string/pref_debug"
android:key="@string/pref_debug_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_background_mode"
android:key="@string/pref_background_mode_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_service_notification"
android:key="@string/pref_service_notification_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_animation_enable_title"
android:key="@string/pref_animation_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_autostart"
android:key="@string/pref_autostart_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_incoming_call_timeout_title"
android:key="@string/pref_incoming_call_timeout_key"
android:layout="@layout/hidden"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_remote_provisioning_title"
android:key="@string/pref_remote_provisioning_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_debug"
android:key="@string/pref_debug_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_background_mode"
android:key="@string/pref_background_mode_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_service_notification"
android:key="@string/pref_service_notification_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_animation_enable_title"
android:key="@string/pref_animation_enable_key"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/pref_autostart"
android:key="@string/pref_autostart_key"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_incoming_call_timeout_title"
android:key="@string/pref_incoming_call_timeout_key"
android:layout="@layout/hidden"
android:persistent="false"/>
<EditTextPreference
android:title="@string/pref_remote_provisioning_title"
android:key="@string/pref_remote_provisioning_key"
android:persistent="false"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_primary_account_title">
@ -312,7 +358,7 @@
android:persistent="false"/>
</PreferenceCategory>
<PreferenceScreen
android:title="@string/pref_audio_hacks_title"
android:layout="@layout/hidden">

View file

@ -429,6 +429,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
}
private void changeFragment(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) {
FragmentManager fm = getFragmentManager();
FragmentTransaction transaction = fm.beginTransaction();
@ -456,7 +457,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
fm.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}
transaction.replace(R.id.fragmentContainer, newFragment, newFragmentType.toString());
transaction.commit();
fm.executePendingTransactions();

View file

@ -23,7 +23,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
@ -43,6 +42,7 @@ import org.linphone.ui.PreferencesListFragment;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.os.Bundle;
@ -64,6 +64,10 @@ public class SettingsFragment extends PreferencesListFragment {
private LinphonePreferences mPrefs;
private Handler mHandler = new Handler();
private LinphoneCoreListenerBase mListener;
public SettingsFragment() {
super(R.xml.preferences);
}
@Override
public void onCreate(Bundle bundle) {
@ -71,7 +75,6 @@ public class SettingsFragment extends PreferencesListFragment {
mPrefs = LinphonePreferences.instance();
removePreviousPreferencesFile(); // Required when updating the preferences order
addPreferencesFromResource(R.xml.preferences);
mListener = new LinphoneCoreListenerBase() {
@Override
@ -85,19 +88,19 @@ public class SettingsFragment extends PreferencesListFragment {
echoCancellerCalibration.setSummary(R.string.no_echo);
echoCancellation.setChecked(false);
LinphonePreferences.instance().setEchoCancellation(false);
((AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
((AudioManager)getActivity().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
Log.i("Set audio mode on 'Normal'");
} else if (status == EcCalibratorStatus.Done) {
echoCancellerCalibration.setSummary(String.format(getString(R.string.ec_calibrated), delayMs));
echoCancellation.setChecked(true);
LinphonePreferences.instance().setEchoCancellation(true);
((AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
((AudioManager)getActivity().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
Log.i("Set audio mode on 'Normal'");
} else if (status == EcCalibratorStatus.Failed) {
echoCancellerCalibration.setSummary(R.string.failed);
echoCancellation.setChecked(true);
LinphonePreferences.instance().setEchoCancellation(true);
((AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
((AudioManager)getActivity().getSystemService(Context.AUDIO_SERVICE)).setMode(AudioManager.MODE_NORMAL);
Log.i("Set audio mode on 'Normal'");
}
}
@ -109,6 +112,10 @@ public class SettingsFragment extends PreferencesListFragment {
}
private void removePreviousPreferencesFile() {
SharedPreferences.Editor editor = getPreferenceManager().getSharedPreferences().edit();
editor.clear();
editor.commit();
File dir = new File(getActivity().getFilesDir().getAbsolutePath() + "shared_prefs");
LinphoneUtils.recursiveFileRemoval(dir);
}
@ -175,7 +182,7 @@ public class SettingsFragment extends PreferencesListFragment {
}
if (!Version.isVideoCapable() || !LinphoneManager.getLcIfManagerNotDestroyedOrNull().isVideoSupported()) {
uncheckAndHidePreference(R.string.pref_video_enable_key);
emptyAndHidePreference(R.string.pref_video_key);
} else {
if (!AndroidCameraConfiguration.hasFrontCamera()) {
uncheckAndHidePreference(R.string.pref_video_use_front_camera_key);
@ -188,7 +195,6 @@ public class SettingsFragment extends PreferencesListFragment {
if (getResources().getBoolean(R.bool.hide_camera_settings)) {
emptyAndHidePreference(R.string.pref_video_key);
hidePreference(R.string.pref_video_enable_key);
}
if (getResources().getBoolean(R.bool.disable_every_log)) {
@ -249,12 +255,18 @@ public class SettingsFragment extends PreferencesListFragment {
private void setPreferenceDefaultValueAndSummary(int pref, String value) {
if (value != null) {
EditTextPreference etPref = (EditTextPreference) findPreference(getString(pref));
etPref.setText(value);
etPref.setSummary(value);
if (etPref != null) {
etPref.setText(value);
etPref.setSummary(value);
}
}
}
private void initTunnelSettings() {
if (!LinphoneManager.getLc().isTunnelAvailable()) {
return;
}
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost());
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_port_key, String.valueOf(mPrefs.getTunnelPort()));
ListPreference tunnelModePref = (ListPreference) findPreference(getString(R.string.pref_tunnel_mode_key));
@ -580,7 +592,7 @@ public class SettingsFragment extends PreferencesListFragment {
synchronized (SettingsFragment.this) {
preference.setSummary(R.string.ec_calibrating);
int recordAudio = getContext().getPackageManager().checkPermission(Manifest.permission.RECORD_AUDIO, getContext().getPackageName());
int recordAudio = getActivity().getPackageManager().checkPermission(Manifest.permission.RECORD_AUDIO, getActivity().getPackageName());
if (recordAudio == PackageManager.PERMISSION_GRANTED) {
startEchoCancellerCalibration();
} else {

View file

@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.R;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.xmlrpc.XmlRpcHelper;
import org.linphone.xmlrpc.XmlRpcListenerBase;
@ -32,7 +32,6 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
/**
@ -40,7 +39,6 @@ import android.widget.Toast;
*/
public class RemoteProvisioningLoginActivity extends Activity implements OnClickListener {
private EditText login, password, domain;
private ImageView cancel;
private Button connect;
private LinphoneCoreListenerBase mListener;
@ -53,9 +51,6 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
password = (EditText) findViewById(R.id.assistant_password);
domain = (EditText) findViewById(R.id.assistant_domain);
//cancel = (ImageView) findViewById(R.id.cancel);
//cancel.setOnClickListener(this);
connect = (Button) findViewById(R.id.assistant_connect);
connect.setOnClickListener(this);
@ -86,8 +81,6 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
}
private boolean storeAccount(String username, String password, String domain) {
LinphoneCore lc = LinphoneManager.getLc();
XmlRpcHelper xmlRpcHelper = new XmlRpcHelper();
xmlRpcHelper.getRemoteProvisioningFilenameAsync(new XmlRpcListenerBase() {
@Override

View file

@ -70,7 +70,7 @@ public class PreferencesListFragment extends ListFragment {
}
// Must be provided
public PreferencesListFragment(){
public PreferencesListFragment() {
}
@ -123,7 +123,7 @@ public class PreferencesListFragment extends ListFragment {
m.setAccessible(true);
m.invoke(mPreferenceManager);
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] onStop " + e);
}
}
@ -136,7 +136,7 @@ public class PreferencesListFragment extends ListFragment {
m.setAccessible(true);
m.invoke(mPreferenceManager);
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] onDestroy " + e);
}
}
@ -154,7 +154,7 @@ public class PreferencesListFragment extends ListFragment {
m.setAccessible(true);
m.invoke(mPreferenceManager, requestCode, resultCode, data);
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] onActivityResult " + e);
}
}
@ -188,7 +188,7 @@ public class PreferencesListFragment extends ListFragment {
PreferenceManager preferenceManager = c.newInstance(this.getActivity(), FIRST_REQUEST_CODE);
return preferenceManager;
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] onCreatePreferenceManager " + e);
return null;
}
}
@ -215,7 +215,7 @@ public class PreferencesListFragment extends ListFragment {
postBindPreferences();
}
}catch(Exception e){
Log.e(e);
Log.e("[PreferencesListFragment] setPreferenceScreen " + e);
}
}
@ -231,7 +231,7 @@ public class PreferencesListFragment extends ListFragment {
m.setAccessible(true);
return (PreferenceScreen) m.invoke(mPreferenceManager);
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] getPreferenceScreen " + e);
}
return null;
@ -250,7 +250,7 @@ public class PreferencesListFragment extends ListFragment {
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(mPreferenceManager, getActivity(), preferencesResId, getPreferenceScreen());
setPreferenceScreen(prefScreen);
} catch(Exception e) {
Log.e(e);
Log.e("[PreferencesListFragment] addPreferencesFromResource " + e);
}
}
@ -263,6 +263,7 @@ public class PreferencesListFragment extends ListFragment {
*/
public Preference findPreference(CharSequence key) {
if (mPreferenceManager == null) {
Log.e("[PreferencesListFragment] PreferenceManager is null !");
return null;
}
return mPreferenceManager.findPreference(key);