Add explanatory text displayed when 'Always-on' switch is greyed-out for VPN apps w/targetSdk<24
Bug: 28413917 Change-Id: I3e7c079b4f91c02e5d0c0e8fda4ac6775dd0247b
This commit is contained in:
@@ -224,8 +224,14 @@ public class AppManagementFragment extends SettingsPreferenceFragment
|
||||
mPreferenceForget.checkRestrictionAndSetDisabled(UserManager.DISALLOW_CONFIG_VPN,
|
||||
mUserId);
|
||||
|
||||
if (!checkTargetVersion()) {
|
||||
if (checkTargetVersion()) {
|
||||
// setSummary doesn't override the admin message when user restriction is applied
|
||||
mPreferenceAlwaysOn.setSummary(null);
|
||||
// setEnabled is not required here, as checkRestrictionAndSetDisabled
|
||||
// should have refreshed the enable state.
|
||||
} else {
|
||||
mPreferenceAlwaysOn.setEnabled(false);
|
||||
mPreferenceAlwaysOn.setSummary(R.string.vpn_not_supported_by_this_app);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user