From da625818406936eb88c7bfda7dda4db5f278eba1 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 24 Feb 2021 14:45:39 +0900 Subject: [PATCH] Add public alternative for protectFromVpn The method is called directly by VpnService#protect. Bug: 171540887 Test: m Change-Id: I7cbb1ef1301dcf8d27b2cc39c0431a0156fe3442 --- framework/src/android/net/NetworkUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/android/net/NetworkUtils.java b/framework/src/android/net/NetworkUtils.java index 9ccb04a44a..b5e8a614b8 100644 --- a/framework/src/android/net/NetworkUtils.java +++ b/framework/src/android/net/NetworkUtils.java @@ -91,7 +91,8 @@ public class NetworkUtils { * this socket will go directly to the underlying network, so its traffic will not be * forwarded through the VPN. */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553, + publicAlternatives = "Use {@link android.net.VpnService#protect} instead.") public static native boolean protectFromVpn(FileDescriptor fd); /**