From 760712201ef7ccee2f37ba930129f6a69153723d Mon Sep 17 00:00:00 2001 From: Cassie Wang Date: Tue, 25 Jul 2023 10:12:18 +0900 Subject: [PATCH] Add a config to show the Vpn options menu. Bug: 290124499 Test: m -j32 Settings Change-Id: I14d59b656e917f6fb7a495f14297c594a115c018 --- res/values/config.xml | 3 +++ src/com/android/settings/vpn2/VpnSettings.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/res/values/config.xml b/res/values/config.xml index 334d4e574c58..2c683ea342ff 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -661,6 +661,9 @@ false + + true + @string/config_settingsintelligence_package_name diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index a91bb6c7e66d..e9b6a4ed52d1 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -142,6 +142,11 @@ public void onActivityCreated(Bundle savedInstanceState) { @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(