Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76071220 authored by Cassie Wang's avatar Cassie Wang
Browse files

Add a config to show the Vpn options menu.

Bug: 290124499
Test: m -j32 Settings
Change-Id: I14d59b656e917f6fb7a495f14297c594a115c018
parent 00f5d9e7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+5 −0
Original line number Diff line number Diff line
@@ -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(