]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Show an error dialog if we can't get permission for VPNs
authorTobias Brunner <tobias@strongswan.org>
Mon, 4 Jun 2018 14:46:25 +0000 (16:46 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 3 Jul 2018 09:31:32 +0000 (11:31 +0200)
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.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/MainActivity.java
src/frontends/android/app/src/main/res/values-de/strings.xml
src/frontends/android/app/src/main/res/values-pl/strings.xml
src/frontends/android/app/src/main/res/values-ru/strings.xml
src/frontends/android/app/src/main/res/values-ua/strings.xml
src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
src/frontends/android/app/src/main/res/values/strings.xml

index c0e375da45a5fd866fd3b4c21f6b13230b180b95..cd5504ac9b31db13f1c37ae39ece232531bb21e2 100644 (file)
@@ -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);
index 49a0ab411e85e1ec6b59bd7b48e07ea85ceff457..ec4c80fe861eaa6d1b880980bbc818667cbf7a47 100644 (file)
@@ -24,7 +24,8 @@
     <string name="search">Suchen</string>
     <string name="vpn_not_supported_title">VPN nicht unterstützt</string>
     <string name="vpn_not_supported">Ihr Gerät unterstützt keine VPN Anwendungen.\nBitte kontaktieren Sie den Hersteller.</string>
-    <string name="vpn_not_supported_during_lockdown">VPN Verbindungen sind nicht möglich im abgeriegelten Modus.</string>
+    <string name="vpn_not_supported_during_lockdown">VPN Verbindungen sind nicht möglich, wenn für ein eingebautes VPN der Always-On-Modus aktiviert ist.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">Laden&#8230;</string>
     <string name="profile_not_found">Profil nicht gefunden</string>
     <string name="strongswan_shortcut">strongSwan-Verknüpfung</string>
index 61fd3f09eefdaae7008e92604b249cf758a2732b..3bf24a4191f7383fc2cdb7313d4a481692b44297 100644 (file)
@@ -24,7 +24,8 @@
     <string name="search">Szukaj</string>
     <string name="vpn_not_supported_title">Nie obsługiwany VPN</string>
     <string name="vpn_not_supported">Urządzenie nie obsługuje aplikacji VPN.\nProszę skontaktować się z producentem.</string>
-    <string name="vpn_not_supported_during_lockdown">Polączenia nie sa możliwe w trybie zamkniętym</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">Wczytywanie&#8230;</string>
     <string name="profile_not_found">Nie znaleziono profilu</string>
     <string name="strongswan_shortcut">Skrót strongSwan</string>
index a2b3ada45df2b2caa6da504c06e534ca08d14158..f4e59675855cddd9d5a7b261d5c8b265dfe3940b 100644 (file)
@@ -21,7 +21,8 @@
     <string name="search">Поиск</string>
     <string name="vpn_not_supported_title">VPN не поддерживается</string>
     <string name="vpn_not_supported">Ваше устройство не поддерживат VPN приложение.\nПожалуйста свяжитесь с производителем.</string>
-    <string name="vpn_not_supported_during_lockdown">VPN соединения не поддерживаются в режиме lockdown.</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">Загрузка&#8230;</string>
     <string name="profile_not_found">Профиль не найден</string>
     <string name="strongswan_shortcut">Ссылка на strongSwan</string>
index bfe4719cda61da01af1e512eb07df6b0360e8883..931c09a6fbf40aa771973c55be65b6cb0d14cde6 100644 (file)
@@ -22,7 +22,8 @@
     <string name="search">Пошук</string>
     <string name="vpn_not_supported_title">VPN не підтримуеться</string>
     <string name="vpn_not_supported">Ваш пристрій не підтримує VPN.\nЗв\'яжіться з виробником.</string>
-    <string name="vpn_not_supported_during_lockdown">VPN з\'єднання не пітримується у режимі lockdown.</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">Завантаження&#8230;</string>
     <string name="profile_not_found">Профіль не знайдено</string>
     <string name="strongswan_shortcut">strongSwan посилання</string>
index bda7324437d232a31645c227e81f18b46a898efe..7291ccb6c62093f49de7ac4466c650e5e4e353c7 100644 (file)
@@ -21,7 +21,8 @@
     <string name="search">搜索</string>
     <string name="vpn_not_supported_title">无法支持VPN</string>
     <string name="vpn_not_supported">您的设备无法支持VPN应用。\n请联系供应商。</string>
-    <string name="vpn_not_supported_during_lockdown">锁定模式下无法支持VPN连接</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">载入中&#8230;</string>
     <string name="profile_not_found">未找到配置</string>
     <string name="strongswan_shortcut">strongSwan快捷方式</string>
index 2d4992333563be09fc93137703382da26eb4fd27..5283d368a015001a03f42955068915855242c181 100644 (file)
@@ -21,7 +21,8 @@
     <string name="search">搜尋</string>
     <string name="vpn_not_supported_title">無法支援VPN</string>
     <string name="vpn_not_supported">您的設備無法使用VPN。\n請聯絡供應商。</string>
-    <string name="vpn_not_supported_during_lockdown">鎖定模式無法連線VPN</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">載入中&#8230;</string>
     <string name="profile_not_found">沒有找到設定檔</string>
     <string name="strongswan_shortcut">strongSwan快速選單</string>
index dd22d3be7184372e5ba7f3ccbd3f3f7ee018c992..5c88e43ea0297b43a1d64127f0558f94bbe89714 100644 (file)
@@ -24,7 +24,8 @@
     <string name="search">Search</string>
     <string name="vpn_not_supported_title">VPN not supported</string>
     <string name="vpn_not_supported">Your device does not support VPN applications.\nPlease contact the manufacturer.</string>
-    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported in lockdown mode.</string>
+    <string name="vpn_not_supported_during_lockdown">VPN connections are not supported if a built-in VPN has the always-on feature enabled.</string>
+    <string name="vpn_not_supported_no_permission">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.</string>
     <string name="loading">Loading&#8230;</string>
     <string name="profile_not_found">Profile not found</string>
     <string name="strongswan_shortcut">strongSwan shortcut</string>