Skip to content
Snippets Groups Projects
Commit 338e7cfa authored by Alexandre Lision's avatar Alexandre Lision
Browse files

account edition: password is correctly set.

parent 39aee334
No related branches found
No related tags found
No related merge requests found
...@@ -33,8 +33,8 @@ as that of the covered work. ...@@ -33,8 +33,8 @@ as that of the covered work.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sflphone" package="org.sflphone"
android:installLocation="auto" android:installLocation="auto"
android:versionCode="10" android:versionCode="11"
android:versionName="1.2.3.15" > android:versionName="1.2.3.16" >
<supports-screens <supports-screens
android:anyDensity="true" android:anyDensity="true"
......
...@@ -32,6 +32,7 @@ package org.sflphone.fragments; ...@@ -32,6 +32,7 @@ package org.sflphone.fragments;
import org.sflphone.R; import org.sflphone.R;
import org.sflphone.account.AccountDetail; import org.sflphone.account.AccountDetail;
import org.sflphone.account.AccountDetailBasic;
import org.sflphone.model.Account; import org.sflphone.model.Account;
import org.sflphone.views.PasswordPreference; import org.sflphone.views.PasswordPreference;
...@@ -134,19 +135,23 @@ public class GeneralAccountFragment extends PreferenceFragment { ...@@ -134,19 +135,23 @@ public class GeneralAccountFragment extends PreferenceFragment {
Log.i(TAG, "Changing preference value:" + newValue); Log.i(TAG, "Changing preference value:" + newValue);
if (preference instanceof CheckBoxPreference) { if (preference instanceof CheckBoxPreference) {
mCallbacks.getAccount().getBasicDetails().setDetailString(preference.getKey(), ((Boolean) newValue).toString()); mCallbacks.getAccount().getBasicDetails().setDetailString(preference.getKey(), newValue.toString());
} else { } else {
if (preference instanceof PasswordPreference) { if (preference instanceof PasswordPreference) {
String tmp = new String(); String tmp = new String();
for (int i = 0; i < ((String) newValue).length(); ++i) { for (int i = 0; i < ((String) newValue).length(); ++i) {
tmp += "*"; tmp += "*";
} }
mCallbacks.getAccount().getCredentials().get(0).setDetailString(preference.getKey(), newValue.toString());
preference.setSummary(tmp); preference.setSummary(tmp);
} else } else if(preference.getKey().contentEquals(AccountDetailBasic.CONFIG_ACCOUNT_USERNAME)) {
mCallbacks.getAccount().getCredentials().get(0).setDetailString(preference.getKey(), newValue.toString());
preference.setSummary((CharSequence) newValue);
} else {
preference.setSummary((CharSequence) newValue); preference.setSummary((CharSequence) newValue);
}
mCallbacks.getAccount().getBasicDetails().setDetailString(preference.getKey(), ((CharSequence) newValue).toString()); mCallbacks.getAccount().getBasicDetails().setDetailString(preference.getKey(), newValue.toString());
} }
mCallbacks.getAccount().notifyObservers(); mCallbacks.getAccount().notifyObservers();
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment