Merge \"Add explanatory text displayed when \'Always-on\' switch is greyed-out for VPN apps w/targetSdk<24\" into nyc-mr1-dev

am: 4ffd7552a3

Change-Id: Id90c39eba4f3ce589dd29fe59177f45e7b684c2f
This commit is contained in:
Victor Chang
2016-06-27 17:19:41 +00:00
committed by android-build-merger
2 changed files with 9 additions and 1 deletions

View File

@@ -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);
}
}
}