diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-10 02:21:44 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-10 02:21:44 +0100 |
commit | 599e93addd79f51959009df558accfa66b6bc15d (patch) | |
tree | 687d03f8687836e2d26dfd4ecc603002437821bd /app/src/main/java/se | |
parent | c38240b5776cc2e5b1057652787367ffb80eb5a1 (diff) |
move optional arguments to the back in ProviderAPI's error handling methods
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerBase.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerBase.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerBase.java index 7872fb32..dc15e578 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerBase.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerBase.java @@ -200,7 +200,7 @@ public abstract class ProviderApiManagerBase { } catch (TimeoutException e) { serviceCallback.stopTorService(); Bundle result = new Bundle(); - setErrorResult(result, action, R.string.error_tor_timeout, ERROR_TOR_TIMEOUT.toString()); + setErrorResult(result, R.string.error_tor_timeout, ERROR_TOR_TIMEOUT.toString(), action); sendToReceiverOrBroadcast(receiver, TOR_TIMEOUT, result, provider); return; } @@ -359,7 +359,7 @@ public abstract class ProviderApiManagerBase { } } - private void addErrorMessageToJson(JSONObject jsonObject, String initialAction, String errorMessage, String errorId) { + private void addErrorMessageToJson(JSONObject jsonObject, String errorMessage, String errorId, String initialAction) { try { jsonObject.put(ERRORS, errorMessage); jsonObject.putOpt(ERRORID, errorId); @@ -940,13 +940,13 @@ public abstract class ProviderApiManagerBase { } Bundle setErrorResult(Bundle result, int errorMessageId, String errorId) { - return setErrorResult(result, null, errorMessageId, errorId); + return setErrorResult(result, errorMessageId, errorId, null); } - Bundle setErrorResult(Bundle result, String initialAction, int errorMessageId, String errorId) { + Bundle setErrorResult(Bundle result, int errorMessageId, String errorId, String initialAction) { JSONObject errorJson = new JSONObject(); String errorMessage = getProviderFormattedString(resources, errorMessageId); - addErrorMessageToJson(errorJson, initialAction, errorMessage, errorId); + addErrorMessageToJson(errorJson, errorMessage, errorId, initialAction); VpnStatus.logWarning("[API] error: " + errorMessage); result.putString(ERRORS, errorJson.toString()); result.putBoolean(BROADCAST_RESULT_KEY, false); |