From b5c9e3567f65917247a8a16ba5618f35b88f420a Mon Sep 17 00:00:00 2001 From: paulhu Date: Mon, 12 Jul 2021 15:14:59 +0000 Subject: [PATCH] Update network preference priority value for VPN Currently netd supports only the default value for VPN but CS send priorty value 1 to netd. It will break the default routing for VPN. Thus, update network preference priority value to 0 for VPN. Bug: 193245476 Test: atest CtsHostsideNetworkTests:HostsideVpnTests Original-Change: https://android-review.googlesource.com/1762867 Merged-In: I197cb358e8e30355fbf675e4c623abebe7abdb7f Change-Id: I197cb358e8e30355fbf675e4c623abebe7abdb7f --- service/src/com/android/server/ConnectivityService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index f6639dc987..1fdb72f51d 100644 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java @@ -428,7 +428,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // PREFERENCE_PRIORITY_NONE when sending to netd. static final int PREFERENCE_PRIORITY_DEFAULT = 1000; // As a security feature, VPNs have the top priority. - static final int PREFERENCE_PRIORITY_VPN = 1; + static final int PREFERENCE_PRIORITY_VPN = 0; // Netd supports only 0 for VPN. // Priority of per-app OEM preference. See {@link #setOemNetworkPreference}. @VisibleForTesting static final int PREFERENCE_PRIORITY_OEM = 10;