Refactor the condition order
Bug: 239984274 Test: atest -c VpnSettingsTest Change-Id: Ic9e8c775b044fffd5dec5047fb53d75209418d85
This commit is contained in:
@@ -635,11 +635,13 @@ public class VpnSettings extends RestrictedSettingsFragment implements
|
||||
if (apps != null) {
|
||||
for (AppOpsManager.PackageOps pkg : apps) {
|
||||
int userId = UserHandle.getUserId(pkg.getUid());
|
||||
if (!profileIds.contains(userId)
|
||||
|| isAdvancedVpn(featureProvider, pkg.getPackageName(), context)) {
|
||||
if (!profileIds.contains(userId)) {
|
||||
// Skip packages for users outside of our profile group.
|
||||
continue;
|
||||
}
|
||||
if (isAdvancedVpn(featureProvider, pkg.getPackageName(), context)) {
|
||||
continue;
|
||||
}
|
||||
// Look for a MODE_ALLOWED permission to activate VPN.
|
||||
boolean allowed = false;
|
||||
for (AppOpsManager.OpEntry op : pkg.getOps()) {
|
||||
|
Reference in New Issue
Block a user