diff options
| author | 2022-05-12 17:11:00 +0000 | |
|---|---|---|
| committer | 2022-05-12 17:11:00 +0000 | |
| commit | e3b18ac1c33bb8a4bd82bea6fc5a77fe61a8f76a (patch) | |
| tree | c51aaa95df18ed4e7f90f13744b1174c6cf486e8 | |
| parent | 5fb12d298f2463112fc67f8e6fc5515d9bddd2cc (diff) | |
| parent | a8455d088b742a9f50a429ed20b7473b6cf0370e (diff) | |
Merge "Add in sandbox UIDs when configuring VPN." into tm-dev am: a8455d088b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17884328
Change-Id: I40769c3fa54ffd3d2d37574c116ae674ca73c98c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/connectivity/Vpn.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index e713e171c4be..312da9a7243e 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -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; } |