summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderAPI.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-08-13 09:28:13 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-08-13 09:28:13 -0600
commit2dc51029679b04599c16ec728404ef2442e35510 (patch)
tree56e400bc805ba6f91aeb52b059d4fa7f9f4cca22 /src/se/leap/leapclient/ProviderAPI.java
parenta383161777a94eedb3911bfca1f0d79cf2eba81f (diff)
parentde28df6f62949e6142f8bc1b5363137906a6d7a3 (diff)
Merge branch 'feature/retry-login-retain-username' into develop
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 11dfabf1..d41d7662 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -151,10 +151,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 (action.equalsIgnoreCase(LOG_OUT)) {
if(logOut(parameters)) {
@@ -222,27 +219,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;