Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Add a config to show the Vpn options menu." into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassie Wang authored and Gerrit Code Review committed Oct 23, 2023
2 parents f1cbe74 + 7607122 commit 5abd342
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@
<!-- Whether to enable the advanced vpn feature. The default is not to. -->
<bool name="config_advanced_vpn_enabled">false</bool>

<!-- Whether to show the VPN options menu. The default is to show it. -->
<bool name="config_show_vpn_options">true</bool>

<!-- An array of uid name for which packages exempt from Wi-Fi permission check. -->
<string-array name="config_exempt_wifi_permission_uid_name" translatable="false">
<item>@string/config_settingsintelligence_package_name</item>
Expand Down
5 changes: 5 additions & 0 deletions src/com/android/settings/vpn2/VpnSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5abd342

Please sign in to comment.