Add a config to show the Vpn options menu.

Bug: 290124499
Test: m -j32 Settings
Change-Id: I14d59b656e917f6fb7a495f14297c594a115c018
This commit is contained in:
Cassie Wang
2023-07-25 10:12:18 +09:00
parent 00f5d9e7a6
commit 760712201e
2 changed files with 8 additions and 0 deletions

View File

@@ -142,6 +142,11 @@ public class VpnSettings extends RestrictedSettingsFragment implements
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
if (!getContext().getResources().getBoolean(R.bool.config_show_vpn_options)) {
return;
}
// Although FEATURE_IPSEC_TUNNELS should always be present in android S and beyond,
// keep this check here just to be safe.
if (!getContext().getPackageManager().hasSystemFeature(