From da7129d862dac00b72df17a4f08aa8f6e7c09543 Mon Sep 17 00:00:00 2001 From: paulhu Date: Mon, 12 Jul 2021 18:07:27 +0800 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 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 41b093ee7b..770aa8a7cf 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;