From 599e93addd79f51959009df558accfa66b6bc15d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 10 Nov 2021 02:21:44 +0100 Subject: move optional arguments to the back in ProviderAPI's error handling methods --- .../bitmaskclient/providersetup/ProviderApiManagerBase.java | 10 +++++----- 1 file 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); -- cgit v1.2.3