summaryrefslogtreecommitdiff
path: root/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-05-01 10:34:33 +0200
committerParménides GV <parmegv@sdf.org>2015-05-01 10:34:33 +0200
commite2e90dab0fcad09b342630617dd9da8be3d23f8c (patch)
tree18671f6716133ca2dc2a059b82ad86d45d555fa5 /app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
parent834fe99739264d498e3e8c87002b0e92cf8160a0 (diff)
parent436de7afeea2cd234db8a4b70ace396101126e88 (diff)
Merge branch 'feature/Move-log-in-button-to-the-Dashboard-6911' into feature/Look-for-a-better-solution-to-the-VPN-slider-#6863
Diffstat (limited to 'app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
index 5d94d180..2d7e13fe 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -38,6 +38,9 @@ import javax.net.ssl.*;
import se.leap.bitmaskclient.ProviderListContent.*;
import se.leap.bitmaskclient.eip.*;
+import se.leap.bitmaskclient.userstatus.SessionDialog;
+import se.leap.bitmaskclient.userstatus.User;
+import se.leap.bitmaskclient.userstatus.UserStatus;
/**
* Implements HTTP api methods used to manage communications with the provider server.
@@ -145,7 +148,7 @@ public class ProviderAPI extends IntentService {
receiver.send(PROVIDER_NOK, result);
}
} else if (action.equalsIgnoreCase(SIGN_UP)) {
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.SIGNING_UP, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.SIGNING_UP, resources);
Bundle result = tryToRegister(parameters);
if (result.getBoolean(RESULT_KEY)) {
receiver.send(SUCCESSFUL_SIGNUP, result);
@@ -153,23 +156,24 @@ public class ProviderAPI extends IntentService {
receiver.send(FAILED_SIGNUP, result);
}
} else if (action.equalsIgnoreCase(LOG_IN)) {
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.LOGGING_IN, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.LOGGING_IN, resources);
Bundle result = tryToAuthenticate(parameters);
if (result.getBoolean(RESULT_KEY)) {
receiver.send(SUCCESSFUL_LOGIN, result);
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.LOGGED_IN, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.LOGGED_IN, resources);
} else {
receiver.send(FAILED_LOGIN, result);
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.NOT_LOGGED_IN, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.NOT_LOGGED_IN, resources);
}
} else if (action.equalsIgnoreCase(LOG_OUT)) {
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.LOGGING_OUT, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.LOGGING_OUT, resources);
if (logOut()) {
receiver.send(SUCCESSFUL_LOGOUT, Bundle.EMPTY);
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.LOGGED_OUT, resources);
+ android.util.Log.d(TAG, "Logged out, notifying user status");
+ UserStatus.updateStatus(UserStatus.SessionStatus.LOGGED_OUT, resources);
} else {
receiver.send(LOGOUT_FAILED, Bundle.EMPTY);
- UserSessionStatus.updateStatus(UserSessionStatus.SessionStatus.DIDNT_LOG_OUT, resources);
+ UserStatus.updateStatus(UserStatus.SessionStatus.DIDNT_LOG_OUT, resources);
}
} else if (action.equalsIgnoreCase(DOWNLOAD_CERTIFICATE)) {
if (updateVpnCertificate()) {