summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-09-04 18:16:45 +0200
committerParménides GV <parmegv@sdf.org>2013-09-30 11:13:45 +0200
commit571b935f6ef8a3662fb506d3228efbfced6f24af (patch)
tree85d4744be48d4a30b6f0793d9bae04ce2f9b9303 /src/se/leap/leapclient/ProviderAPI.java
parent6112dcbb6a430651f172a7a07f2e9b7633299705 (diff)
Moved result constants to ProviderAPI.
Diffstat (limited to 'src/se/leap/leapclient/ProviderAPI.java')
-rw-r--r--src/se/leap/leapclient/ProviderAPI.java42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java
index 0b3e6f45..58dc8214 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -92,6 +92,24 @@ public class ProviderAPI extends IntentService {
PARAMETERS = "parameters"
;
+ final public static int
+ CUSTOM_PROVIDER_ADDED = 0,
+ CORRECTLY_DOWNLOADED_JSON_FILES = 1,
+ INCORRECTLY_DOWNLOADED_JSON_FILES = 2,
+ SRP_AUTHENTICATION_SUCCESSFUL = 3,
+ SRP_AUTHENTICATION_FAILED = 4,
+ SRP_REGISTRATION_SUCCESSFUL = 5,
+ SRP_REGISTRATION_FAILED = 6,
+ LOGOUT_SUCCESSFUL = 7,
+ LOGOUT_FAILED = 8,
+ CORRECTLY_DOWNLOADED_CERTIFICATE = 9,
+ INCORRECTLY_DOWNLOADED_CERTIFICATE = 10,
+ CORRECTLY_UPDATED_PROVIDER_DOT_JSON = 11,
+ INCORRECTLY_UPDATED_PROVIDER_DOT_JSON = 12,
+ CORRECTLY_DOWNLOADED_ANON_CERTIFICATE = 13,
+ INCORRECTLY_DOWNLOADED_ANON_CERTIFICATE = 14
+ ;
+
public ProviderAPI() {
super("ProviderAPI");
Log.v("ClassName", "Provider API");
@@ -122,42 +140,42 @@ public class ProviderAPI extends IntentService {
if(action.equalsIgnoreCase(DOWNLOAD_JSON_FILES_BUNDLE_EXTRA)) {
if(!downloadJsonFiles(parameters)) {
- receiver.send(ConfigHelper.INCORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
+ receiver.send(INCORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
} else {
- receiver.send(ConfigHelper.CORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
+ receiver.send(CORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
}
} else if(action.equalsIgnoreCase(UPDATE_PROVIDER_DOTJSON)) {
Bundle result = updateProviderDotJSON(parameters);
if(result.getBoolean(ConfigHelper.RESULT_KEY)) {
- receiver.send(ConfigHelper.CORRECTLY_UPDATED_PROVIDER_DOT_JSON, result);
+ receiver.send(CORRECTLY_UPDATED_PROVIDER_DOT_JSON, result);
} else {
- receiver.send(ConfigHelper.INCORRECTLY_UPDATED_PROVIDER_DOT_JSON, Bundle.EMPTY);
+ receiver.send(INCORRECTLY_UPDATED_PROVIDER_DOT_JSON, Bundle.EMPTY);
}
} else if (action.equalsIgnoreCase(DOWNLOAD_NEW_PROVIDER_DOTJSON)) {
Bundle result = downloadNewProviderDotJSON(parameters);
if(result.getBoolean(ConfigHelper.RESULT_KEY)) {
- receiver.send(ConfigHelper.CORRECTLY_UPDATED_PROVIDER_DOT_JSON, result);
+ receiver.send(CORRECTLY_UPDATED_PROVIDER_DOT_JSON, result);
} else {
- receiver.send(ConfigHelper.INCORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
+ receiver.send(INCORRECTLY_DOWNLOADED_JSON_FILES, Bundle.EMPTY);
}
} else if (action.equalsIgnoreCase(SRP_AUTH)) {
Bundle session_id_bundle = authenticateBySRP(parameters);
if(session_id_bundle.getBoolean(ConfigHelper.RESULT_KEY)) {
- receiver.send(ConfigHelper.SRP_AUTHENTICATION_SUCCESSFUL, session_id_bundle);
+ receiver.send(SRP_AUTHENTICATION_SUCCESSFUL, session_id_bundle);
} else {
- receiver.send(ConfigHelper.SRP_AUTHENTICATION_FAILED, session_id_bundle);
+ receiver.send(SRP_AUTHENTICATION_FAILED, session_id_bundle);
}
} else if (action.equalsIgnoreCase(LOG_OUT)) {
if(logOut(parameters)) {
- receiver.send(ConfigHelper.LOGOUT_SUCCESSFUL, Bundle.EMPTY);
+ receiver.send(LOGOUT_SUCCESSFUL, Bundle.EMPTY);
} else {
- receiver.send(ConfigHelper.LOGOUT_FAILED, Bundle.EMPTY);
+ receiver.send(LOGOUT_FAILED, Bundle.EMPTY);
}
} else if (action.equalsIgnoreCase(DOWNLOAD_CERTIFICATE)) {
if(getNewCert(parameters)) {
- receiver.send(ConfigHelper.CORRECTLY_DOWNLOADED_CERTIFICATE, Bundle.EMPTY);
+ receiver.send(CORRECTLY_DOWNLOADED_CERTIFICATE, Bundle.EMPTY);
} else {
- receiver.send(ConfigHelper.INCORRECTLY_DOWNLOADED_CERTIFICATE, Bundle.EMPTY);
+ receiver.send(INCORRECTLY_DOWNLOADED_CERTIFICATE, Bundle.EMPTY);
}
}
}