Make Vpn.isAvailable return available, not unavailable

Also removed the check about secondary users. We already disable
adding a legacy VPN for secondary users inside the Settings page
itself.

We do not want to stop our users from configuring/disabling third
party VPNs, that's completely supported.

Bug: 23693383
Fix: 32308780
Test: manual, needs robotest
Change-Id: I99ab14b6b26582bdd7fc491c4b2542f3e653f3dc
This commit is contained in:
Robin Lee
2016-11-02 12:49:11 +00:00
parent 80d1ec7dee
commit 8be8e626d2

View File

@@ -59,8 +59,7 @@ public class VpnPreferenceController extends PreferenceController {
@Override
public boolean isAvailable() {
// TODO: http://b/23693383
return mIsSecondaryUser || RestrictedLockUtils.hasBaseUserRestriction(mContext,
return !RestrictedLockUtils.hasBaseUserRestriction(mContext,
UserManager.DISALLOW_CONFIG_VPN, UserHandle.myUserId());
}