Update VPN preference state after disallow configuring VPN policy has changed.

1. When Settings > More and change disallow configuring VPN policy
   and resume Settings, update VPN preference state.

2. When Settings > More > VPN and change disallow configuring VPN policy
   and resume VPN Settings, update its state.

Test: manual

Signed-off-by : Sungmin Lee <insight.lee@lge.com>

Change-Id: I4f3c85733ca6ba05cba46e2f4854f54a42b10c21
This commit is contained in:
insight.lee
2016-12-22 16:14:44 +09:00
parent c98ca3da26
commit 7c4d52c570
2 changed files with 13 additions and 2 deletions

View File

@@ -164,6 +164,7 @@ public class VpnSettings extends RestrictedSettingsFragment implements
public void onResume() {
super.onResume();
mUnavailable = mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN);
if (mUnavailable) {
// Show a message to explain that VPN settings have been disabled
if (!isUiRestrictedByOnlyAdmin()) {
@@ -172,6 +173,7 @@ public class VpnSettings extends RestrictedSettingsFragment implements
getPreferenceScreen().removeAll();
return;
} else {
setEmptyView(getEmptyTextView());
getEmptyTextView().setText(R.string.vpn_no_vpns_added);
}