From cce4e61260153dc4826e648f733f7451f73dfa01 Mon Sep 17 00:00:00 2001 From: Charles He Date: Fri, 24 Mar 2017 14:03:55 +0000 Subject: [PATCH] VPN settings: update strings for always-on VPN To conform with UX guidelines and conventions, the following changes are made to the UI of app VPN's PreferenceFragment: (1. Always-on toggle title stays the same) 2. Always-on toggle subtext changes from "active"/"inactive" to an explanation of the feature 3. Lockdown toggle title is shortened 4. Lockdown toggle subtext is removed completely And the following changes are made to the legacy VPN's ConfigDialog: 5. Error message that is displayed below the "Always-on VPN" checkbox 6. Replacing \u2019 with \' Bug: 36382729 Test: manually navigate through VPN settings Test: make SettingsRoboTests Change-Id: If1b4faec8743dfbf6e3f8062b53190ad63700d25 --- res/values/strings.xml | 52 +++++++++++-------- res/xml/vpn_app_management.xml | 5 +- .../settings/vpn2/AppManagementFragment.java | 4 +- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 4eef61ce3c5..9a59a7efbd4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5464,16 +5464,26 @@ (don\u2019t verify server) (received from server) - - The selected VPN type can\u2019t be always on - - Always-on VPN only supports numeric server addresses - - A DNS server must be specified for always-on VPN - - DNS server addresses must be numeric for always-on VPN - - The information entered doesn\u2019t support always-on VPN + + This VPN type can\'t stay connected at all + times + + Always-on VPN only supports numeric server + addresses + + A DNS server must be specified for always-on + VPN + + DNS server addresses must be numeric for + always-on VPN + + The information entered doesn\'t support + always-on VPN Cancel @@ -5529,20 +5539,16 @@ Always-on VPN No VPNs added - - Always-on active - - Always-on inactive - - Not supported by this app - - Only allow connections through VPN - + + Stay connected to VPN at all times + + Not supported by this app + + Block connections without VPN + Require VPN connection? - - Lockdown active - - Lockdown inactive Select a VPN profile to always remain connected to. Network traffic will only be allowed when connected to this VPN. diff --git a/res/xml/vpn_app_management.xml b/res/xml/vpn_app_management.xml index 1b6f37b37b7..c044a58a9f9 100644 --- a/res/xml/vpn_app_management.xml +++ b/res/xml/vpn_app_management.xml @@ -27,8 +27,7 @@ android:key="always_on_vpn" android:title="@string/vpn_menu_lockdown" android:defaultValue="false" - android:summaryOn="@string/vpn_always_on_active" - android:summaryOff="@string/vpn_always_on_inactive" + android:summary="@string/vpn_always_on_summary" settings:userRestriction="no_config_vpn" settings:useAdditionalSummary="true" settings:restrictedSwitchSummary="@string/disabled_by_admin_summary_text" /> @@ -37,8 +36,6 @@ android:key="lockdown_vpn" android:title="@string/vpn_require_connection" android:defaultValue="false" - android:summaryOn="@string/vpn_lockdown_active" - android:summaryOff="@string/vpn_lockdown_inactive" android:dependency="always_on_vpn" settings:userRestriction="no_config_vpn" settings:useAdditionalSummary="true" diff --git a/src/com/android/settings/vpn2/AppManagementFragment.java b/src/com/android/settings/vpn2/AppManagementFragment.java index 9ef087b3df3..75595120fb1 100644 --- a/src/com/android/settings/vpn2/AppManagementFragment.java +++ b/src/com/android/settings/vpn2/AppManagementFragment.java @@ -259,13 +259,13 @@ public class AppManagementFragment extends SettingsPreferenceFragment if (isAlwaysOnSupportedByApp(mPackageInfo.applicationInfo)) { // setSummary doesn't override the admin message when user restriction is applied - mPreferenceAlwaysOn.setSummary(null); + mPreferenceAlwaysOn.setSummary(R.string.vpn_always_on_summary); // setEnabled is not required here, as checkRestrictionAndSetDisabled // should have refreshed the enable state. } else { mPreferenceAlwaysOn.setEnabled(false); mPreferenceLockdown.setEnabled(false); - mPreferenceAlwaysOn.setSummary(R.string.vpn_not_supported_by_this_app); + mPreferenceAlwaysOn.setSummary(R.string.vpn_always_on_summary_not_supported); } } }