summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-07-30 18:46:53 +0200
committerParménides GV <parmegv@sdf.org>2013-07-30 18:46:53 +0200
commitde28df6f62949e6142f8bc1b5363137906a6d7a3 (patch)
treea754856c1597d08be6724e61d38bbe5d4c439799 /src/se/leap/leapclient/ProviderAPI.java
parenta1a03615cb9c4f978142b234f028e718eb91a103 (diff)
Retains username if login process failed.
New login dialog shows the original username, so that if the user failed writing his/her password, s/he does not have to write again the username.
Diffstat (limited to 'src/se/leap/leapclient/ProviderAPI.java')
-rw-r--r--src/se/leap/leapclient/ProviderAPI.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java
index 944a0e7f..d92b48fb 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -142,10 +142,7 @@ public class ProviderAPI extends IntentService {
if(session_id_bundle.getBoolean(ConfigHelper.RESULT_KEY)) {
receiver.send(ConfigHelper.SRP_AUTHENTICATION_SUCCESSFUL, session_id_bundle);
} else {
- Bundle user_message_bundle = new Bundle();
- String user_message_key = getResources().getString(R.string.user_message);
- user_message_bundle.putString(user_message_key, session_id_bundle.getString(user_message_key));
- receiver.send(ConfigHelper.SRP_AUTHENTICATION_FAILED, user_message_bundle);
+ receiver.send(ConfigHelper.SRP_AUTHENTICATION_FAILED, session_id_bundle);
}
}
else if ((task = task_for.getBundleExtra(ConfigHelper.LOG_OUT)) != null) {
@@ -215,27 +212,34 @@ public class ProviderAPI extends IntentService {
} else {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_bad_user_password_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
}
} else {
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_bad_user_password_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
}
} catch (ClientProtocolException e) {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_client_http_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
} catch (IOException e) {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_io_exception_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
} catch (JSONException e) {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_json_exception_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
} catch (NoSuchAlgorithmException e) {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_no_such_algorithm_exception_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
}
} else {
session_id_bundle.putBoolean(ConfigHelper.RESULT_KEY, false);
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_not_valid_password_user_message));
+ session_id_bundle.putString(ConfigHelper.USERNAME_KEY, username);
}
return session_id_bundle;