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

Commit add26a28 authored by Hugh Chen's avatar Hugh Chen Committed by Android (Google) Code Review
Browse files

Merge "Refactor the condition order"

parents 07fcddae 5cf2b7ff
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()) {