From 7ab1d900e7f3bb185ba4d97f53f63f6f84611ec6 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 9 Aug 2022 13:06:43 +0200 Subject: show stop blocking in error dialog if no more gateways of a given transport are available --- .../leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/base/fragments') 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 44998868..ae25c61c 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 @@ -45,6 +45,7 @@ import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.models.Provider; import se.leap.bitmaskclient.eip.EIP; import se.leap.bitmaskclient.eip.EipCommand; +import se.leap.bitmaskclient.eip.VoidVpnService; import se.leap.bitmaskclient.providersetup.ProviderAPICommand; /** @@ -128,7 +129,11 @@ public class MainActivityErrorDialog extends DialogFragment { builder.setNegativeButton(R.string.cancel, (dialog, id) -> {}); break; case NO_MORE_GATEWAYS: - builder.setNegativeButton(R.string.cancel, (dialog, id) -> {}); + builder.setNegativeButton(R.string.vpn_button_turn_off_blocking, (dialog, id) -> { + Intent stopVoidVpnIntent = new Intent (getContext(), VoidVpnService.class); + stopVoidVpnIntent.setAction(EIP_ACTION_STOP_BLOCKING_VPN); + getContext().startService(stopVoidVpnIntent); + }); if (getPreferredCity(applicationContext) != null) { builder.setPositiveButton(R.string.warning_option_try_best, (dialog, which) -> { new Thread(() -> { -- cgit v1.2.3