Deprecation of legacy VPN types no longer depends on the Provider Model

Flag

Bug: 204522922
Test: atest -c SettingsUnitTests
Change-Id: If14354f4c1b5cb1ef74fc8b94b028006ac1a99b3
This commit is contained in:
Jeremy Goldman
2021-11-12 09:54:56 +08:00
parent d8e3836c10
commit ab1b2be739
2 changed files with 23 additions and 31 deletions

View File

@@ -59,7 +59,6 @@ import com.android.internal.net.VpnConfig;
import com.android.internal.net.VpnProfile;
import com.android.settings.R;
import com.android.settings.RestrictedSettingsFragment;
import com.android.settings.Utils;
import com.android.settings.widget.GearPreference;
import com.android.settings.widget.GearPreference.OnGearClickListener;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -130,12 +129,11 @@ public class VpnSettings extends RestrictedSettingsFragment implements
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
// Although FEATURE_IPSEC_TUNNELS should always be present in android S,
// Although FEATURE_IPSEC_TUNNELS should always be present in android S and beyond,
// keep this check here just to be safe.
if (Utils.isProviderModelEnabled(getContext())
&& !getContext().getPackageManager().hasSystemFeature(
PackageManager.FEATURE_IPSEC_TUNNELS)) {
Log.w(LOG_TAG, "FEATURE_IPSEC_TUNNELS missing from system, cannot create new VPNs");
if (!getContext().getPackageManager().hasSystemFeature(
PackageManager.FEATURE_IPSEC_TUNNELS)) {
Log.wtf(LOG_TAG, "FEATURE_IPSEC_TUNNELS missing from system, cannot create new VPNs");
return;
} else {
// By default, we should inflate this menu.