From: Tobias Brunner Date: Mon, 4 Jun 2018 14:46:25 +0000 (+0200) Subject: android: Show an error dialog if we can't get permission for VPNs X-Git-Tag: 5.7.0dr5~20^2~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0917caa19519184f0d87f211dd73ef819b2d56e4;p=thirdparty%2Fstrongswan.git android: Show an error dialog if we can't get permission for VPNs This is either because a third-party VPN app has the always-on feature enabled, or because the user denied the permission in the system's confirmation dialog. If the always-on feature is enabled for a connection of the built-in VPN client we get an IllegalStateException, for which we show an updated and clearer error message. --- diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/MainActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/MainActivity.java index c0e375da45..cd5504ac9b 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/MainActivity.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/MainActivity.java @@ -268,6 +268,10 @@ public class MainActivity extends AppCompatActivity implements OnVpnProfileSelec intent.putExtras(mProfileInfo); this.startService(intent); } + else + { /* this happens if the always-on VPN feature is activated by a different app or the user declined */ + VpnNotSupportedError.showWithMessage(this, R.string.vpn_not_supported_no_permission); + } break; default: super.onActivityResult(requestCode, resultCode, data); diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml index 49a0ab411e..ec4c80fe86 100644 --- a/src/frontends/android/app/src/main/res/values-de/strings.xml +++ b/src/frontends/android/app/src/main/res/values-de/strings.xml @@ -24,7 +24,8 @@ Suchen VPN nicht unterstützt Ihr Gerät unterstützt keine VPN Anwendungen.\nBitte kontaktieren Sie den Hersteller. - VPN Verbindungen sind nicht möglich im abgeriegelten Modus. + VPN Verbindungen sind nicht möglich, wenn für ein eingebautes VPN der Always-On-Modus aktiviert ist. + Keine Berechtigung, um VPN Verbindungen zu erstellen. Entweder weil diese vom Benutzer verweigert wurde oder weil für eine andere VPN Anwendung der Always-On-Modus aktiviert ist. Laden… Profil nicht gefunden strongSwan-Verknüpfung diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml index 61fd3f09ee..3bf24a4191 100644 --- a/src/frontends/android/app/src/main/res/values-pl/strings.xml +++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml @@ -24,7 +24,8 @@ Szukaj Nie obsługiwany VPN Urządzenie nie obsługuje aplikacji VPN.\nProszę skontaktować się z producentem. - Polączenia nie sa możliwe w trybie zamkniętym + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. Wczytywanie… Nie znaleziono profilu Skrót strongSwan diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml index a2b3ada45d..f4e5967585 100644 --- a/src/frontends/android/app/src/main/res/values-ru/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml @@ -21,7 +21,8 @@ Поиск VPN не поддерживается Ваше устройство не поддерживат VPN приложение.\nПожалуйста свяжитесь с производителем. - VPN соединения не поддерживаются в режиме lockdown. + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. Загрузка… Профиль не найден Ссылка на strongSwan diff --git a/src/frontends/android/app/src/main/res/values-ua/strings.xml b/src/frontends/android/app/src/main/res/values-ua/strings.xml index bfe4719cda..931c09a6fb 100644 --- a/src/frontends/android/app/src/main/res/values-ua/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ua/strings.xml @@ -22,7 +22,8 @@ Пошук VPN не підтримуеться Ваш пристрій не підтримує VPN.\nЗв\'яжіться з виробником. - VPN з\'єднання не пітримується у режимі lockdown. + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. Завантаження… Профіль не знайдено strongSwan посилання diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml index bda7324437..7291ccb6c6 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml @@ -21,7 +21,8 @@ 搜索 无法支持VPN 您的设备无法支持VPN应用。\n请联系供应商。 - 锁定模式下无法支持VPN连接 + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. 载入中… 未找到配置 strongSwan快捷方式 diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml index 2d49923335..5283d368a0 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml @@ -21,7 +21,8 @@ 搜尋 無法支援VPN 您的設備無法使用VPN。\n請聯絡供應商。 - 鎖定模式無法連線VPN + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. 載入中… 沒有找到設定檔 strongSwan快速選單 diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml index dd22d3be71..5c88e43ea0 100644 --- a/src/frontends/android/app/src/main/res/values/strings.xml +++ b/src/frontends/android/app/src/main/res/values/strings.xml @@ -24,7 +24,8 @@ Search VPN not supported Your device does not support VPN applications.\nPlease contact the manufacturer. - VPN connections are not supported in lockdown mode. + VPN connections are not supported if a built-in VPN has the always-on feature enabled. + Unable to get permission to create VPN connections. Either because it was denied by the user, or because a different VPN app has the always-on feature enabled. Loading… Profile not found strongSwan shortcut