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) {
|
if (apps != null) {
|
||||||
for (AppOpsManager.PackageOps pkg : apps) {
|
for (AppOpsManager.PackageOps pkg : apps) {
|
||||||
int userId = UserHandle.getUserId(pkg.getUid());
|
int userId = UserHandle.getUserId(pkg.getUid());
|
||||||
if (!profileIds.contains(userId)
|
if (!profileIds.contains(userId)) {
|
||||||
|| isAdvancedVpn(featureProvider, pkg.getPackageName(), context)) {
|
|
||||||
// Skip packages for users outside of our profile group.
|
// Skip packages for users outside of our profile group.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (isAdvancedVpn(featureProvider, pkg.getPackageName(), context)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Look for a MODE_ALLOWED permission to activate VPN.
|
// Look for a MODE_ALLOWED permission to activate VPN.
|
||||||
boolean allowed = false;
|
boolean allowed = false;
|
||||||
for (AppOpsManager.OpEntry op : pkg.getOps()) {
|
for (AppOpsManager.OpEntry op : pkg.getOps()) {
|
||||||
|
Reference in New Issue
Block a user