Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cf2b7ff authored by Hugh Chen's avatar Hugh Chen
Browse files

Refactor the condition order

Bug: 239984274
Test: atest -c VpnSettingsTest
Change-Id: Ic9e8c775b044fffd5dec5047fb53d75209418d85
parent 563e0e0a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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()) {