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

Commit a8455d08 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add in sandbox UIDs when configuring VPN." into tm-dev

parents ca2a3e01 27e9fdd5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1533,11 +1533,17 @@ public class Vpn {
    }

    // Note: Return type guarantees results are deduped and sorted, which callers require.
    // This method also adds the SDK sandbox UIDs corresponding to the applications by default,
    // since apps are generally not aware of them, yet they should follow the VPN configuration
    // of the app they belong to.
    private SortedSet<Integer> getAppsUids(List<String> packageNames, int userId) {
        SortedSet<Integer> uids = new TreeSet<>();
        for (String app : packageNames) {
            int uid = getAppUid(app, userId);
            if (uid != -1) uids.add(uid);
            if (Process.isApplicationUid(uid)) {
                uids.add(Process.toSdkSandboxUid(uid));
            }
        }
        return uids;
    }