Merge "Remove the "+" button on the help menu if no secure vpns can be created" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2fcb8531ab
@@ -59,6 +59,7 @@ 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;
|
||||
@@ -129,8 +130,18 @@ 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,
|
||||
// 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");
|
||||
return;
|
||||
} else {
|
||||
// By default, we should inflate this menu.
|
||||
inflater.inflate(R.menu.vpn, menu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
|
Reference in New Issue
Block a user