From 09eab9ca4367a8e9342588cc40f4b5cb507e5a6f Mon Sep 17 00:00:00 2001 From: lucaslin Date: Fri, 13 May 2022 04:24:11 +0800 Subject: [PATCH] Rename vars of Ikev2VpnRunner There is already a var which is named mNetworkCapabilities in Vpn class. In order to simply distinguish Vpn#mNetworkCapabilities and Ikev2VpnRunner#mNetworkCapabilities, rename the one in Ikev2VpnRunner to mUnderlyingNetworkCapabilities, also change Ikev2VpnRunner#mLinkProperties to mUnderlyingLinkProperties. Bug: 191413541 Test: atest FrameworksNetTest#VpnTest Change-Id: I49a5aee159baa1d1583abb94d73da9fbc03ffe07 (cherry picked from commit c9bd64daf348a224fa75c0538d792721a74291b7) Merged-In: I49a5aee159baa1d1583abb94d73da9fbc03ffe07 --- .../com/android/server/connectivity/Vpn.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index 5e26009c24690..a8cc2c218a7a1 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -2642,8 +2642,8 @@ public class Vpn { @Nullable private IpSecTunnelInterface mTunnelIface; @Nullable private IkeSession mSession; @Nullable private Network mActiveNetwork; - @Nullable private NetworkCapabilities mNetworkCapabilities; - @Nullable private LinkProperties mLinkProperties; + @Nullable private NetworkCapabilities mUnderlyingNetworkCapabilities; + @Nullable private LinkProperties mUnderlyingLinkProperties; private final String mSessionKey; IkeV2VpnRunner(@NonNull Ikev2VpnProfile profile) { @@ -2875,12 +2875,12 @@ public class Vpn { /** Called when the NetworkCapabilities of underlying network is changed */ public void onDefaultNetworkCapabilitiesChanged(@NonNull NetworkCapabilities nc) { - mNetworkCapabilities = nc; + mUnderlyingNetworkCapabilities = nc; } /** Called when the LinkProperties of underlying network is changed */ public void onDefaultNetworkLinkPropertiesChanged(@NonNull LinkProperties lp) { - mLinkProperties = lp; + mUnderlyingLinkProperties = lp; } /** Marks the state as FAILED, and disconnects. */ @@ -2934,9 +2934,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } markFailedAndDisconnect(exception); return; @@ -2952,9 +2952,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } } } else if (exception instanceof IllegalArgumentException) { @@ -2971,9 +2971,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } } else if (exception instanceof IkeNonProtocolException) { if (exception.getCause() instanceof UnknownHostException) { @@ -2986,9 +2986,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } } else if (exception.getCause() instanceof IkeTimeoutException) { // TODO(b/230548427): Remove SDK check once VPN related stuff are @@ -3000,9 +3000,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } } else if (exception.getCause() instanceof IOException) { // TODO(b/230548427): Remove SDK check once VPN related stuff are @@ -3014,9 +3014,9 @@ public class Vpn { getPackage(), mSessionKey, makeVpnProfileStateLocked(), mActiveNetwork, getRedactedNetworkCapabilitiesOfUnderlyingNetwork( - this.mNetworkCapabilities), + mUnderlyingNetworkCapabilities), getRedactedLinkPropertiesOfUnderlyingNetwork( - this.mLinkProperties)); + mUnderlyingLinkProperties)); } } } else if (exception != null) { @@ -3025,8 +3025,8 @@ public class Vpn { } mActiveNetwork = null; - mNetworkCapabilities = null; - mLinkProperties = null; + mUnderlyingNetworkCapabilities = null; + mUnderlyingLinkProperties = null; // Close all obsolete state, but keep VPN alive incase a usable network comes up. // (Mirrors VpnService behavior) @@ -3091,8 +3091,8 @@ public class Vpn { */ private void disconnectVpnRunner() { mActiveNetwork = null; - mNetworkCapabilities = null; - mLinkProperties = null; + mUnderlyingNetworkCapabilities = null; + mUnderlyingLinkProperties = null; mIsRunning = false; resetIkeState();