Merge "VPN settings: grey out policy-restricted menus" am: ee4808d37b
am: 905829393d
* commit '905829393d85db3e5d3f4b18a37c5da7184e6a63':
VPN settings: grey out policy-restricted menus
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index b0a08c8..98b915d 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -129,6 +129,11 @@
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
+ // Disable all actions if VPN configuration has been disallowed
+ for (int i = 0; i < menu.size(); i++) {
+ menu.getItem(i).setEnabled(!mUnavailable);
+ }
+
// Hide lockdown VPN on devices that require IMS authentication
if (SystemProperties.getBoolean("persist.radio.imsregrequired", false)) {
menu.findItem(R.id.vpn_lockdown).setVisible(false);