summaryrefslogtreecommitdiff
path: root/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-02-14 11:48:37 +0100
committerParménides GV <parmegv@sdf.org>2015-02-14 11:48:37 +0100
commitc198dbd9dd583d980ae7e70118f67d09bed8de55 (patch)
treec2863f28134af00f26299c97bb6a81ed0aa4ed96 /app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
parent9d346be65e6808710b9e814d2899e5888984b4ab (diff)
parent4028c100a59c45913cb569c4967faaddc090b1f9 (diff)
Merge branch 'develop'0.9.2
Diffstat (limited to 'app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
index 1dbe11d3..0650f0ad 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -179,28 +179,28 @@ public class ProviderAPI extends IntentService {
}
private Bundle tryToRegister(Bundle task) {
- Bundle session_id_bundle = new Bundle();
+ Bundle result = new Bundle();
int progress = 0;
- String username = (String) task.get(SessionDialog.USERNAME);
- String password = (String) task.get(SessionDialog.PASSWORD);
+ String username = task.getString(SessionDialog.USERNAME);
+ String password = task.getString(SessionDialog.PASSWORD);
if(validUserLoginData(username, password)) {
- session_id_bundle = register(username, password);
+ result = register(username, password);
broadcastProgress(progress++);
} else {
if(!wellFormedPassword(password)) {
- session_id_bundle.putBoolean(RESULT_KEY, false);
- session_id_bundle.putString(SessionDialog.USERNAME, username);
- session_id_bundle.putBoolean(SessionDialog.PASSWORD_INVALID_LENGTH, true);
+ result.putBoolean(RESULT_KEY, false);
+ result.putString(SessionDialog.USERNAME, username);
+ result.putBoolean(SessionDialog.PASSWORD_INVALID_LENGTH, true);
}
- if(username.isEmpty()) {
- session_id_bundle.putBoolean(RESULT_KEY, false);
- session_id_bundle.putBoolean(SessionDialog.USERNAME_MISSING, true);
+ if(!validUsername(username)) {
+ result.putBoolean(RESULT_KEY, false);
+ result.putBoolean(SessionDialog.USERNAME_MISSING, true);
}
}
- return session_id_bundle;
+ return result;
}
private Bundle register(String username, String password) {