summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-02-26 16:24:28 +0100
committercyBerta <cyberta@riseup.net>2021-02-26 16:24:28 +0100
commiteadc74a7e0a99e31044a369508efbbab9d7295f6 (patch)
tree18904482e0c1c026006a0cedf1065eb77a90f9e2 /app/src/main/java/se/leap
parent704bdf92e6265ee4bdb7e177c7d09284ebc29868 (diff)
improve error alerting if vpn launching fails, show an AlertDialog instead of the LogView
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java
index 4b307f23..f036b411 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java
@@ -111,15 +111,15 @@ public class MainActivityErrorDialog extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
Context applicationContext = getContext().getApplicationContext();
- builder.setMessage(reasonToFail)
- .setNegativeButton(R.string.cancel, (dialog, id) -> {
- });
+ builder.setMessage(reasonToFail);
switch (downloadError) {
case ERROR_INVALID_VPN_CERTIFICATE:
builder.setPositiveButton(R.string.update_certificate, (dialog, which) ->
ProviderAPICommand.execute(getContext(), UPDATE_INVALID_VPN_CERTIFICATE, provider));
+ builder.setNegativeButton(R.string.cancel, (dialog, id) -> {});
break;
case NO_MORE_GATEWAYS:
+ builder.setNegativeButton(R.string.cancel, (dialog, id) -> {});
if (provider.supportsPluggableTransports()) {
if (getUsePluggableTransports(applicationContext)) {
builder.setPositiveButton(warning_option_try_ovpn, ((dialog, which) -> {
@@ -139,9 +139,7 @@ public class MainActivityErrorDialog extends DialogFragment {
}
break;
case ERROR_VPN_PREPARE:
- builder.setPositiveButton(R.string.retry, (dialog, which) -> {
- EipCommand.startVPN(applicationContext, false);
- });
+ builder.setPositiveButton(android.R.string.ok, (dialog, which) -> { });
break;
default:
break;