From 333eaa930f9dd0dcfa80eea259a06e5b0f971aa5 Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Thu, 1 Sep 2022 16:18:53 +0900 Subject: [PATCH] Straighten out NetworkAgentConfig's equals() Bug: 244312404 Test: FrameworksNetTests Change-Id: I154f3b2ab898d6f428ccf9efa9ab90992beb1f9f --- framework/src/android/net/NetworkAgentConfig.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/src/android/net/NetworkAgentConfig.java b/framework/src/android/net/NetworkAgentConfig.java index b6f3314c33..da12a0a5ab 100644 --- a/framework/src/android/net/NetworkAgentConfig.java +++ b/framework/src/android/net/NetworkAgentConfig.java @@ -188,7 +188,8 @@ public final class NetworkAgentConfig implements Parcelable { * Set to true if the PRIVATE_DNS_BROKEN notification has shown for this network. * Reset this bit when private DNS mode is changed from strict mode to opportunistic/off mode. * - * This is not parceled, because it would not make sense. + * This is not parceled, because it would not make sense. It's also ignored by the + * equals() and hashcode() methods. * * @hide */ @@ -503,8 +504,10 @@ public final class NetworkAgentConfig implements Parcelable { && provisioningNotificationDisabled == that.provisioningNotificationDisabled && skip464xlat == that.skip464xlat && legacyType == that.legacyType + && legacySubType == that.legacySubType && Objects.equals(subscriberId, that.subscriberId) && Objects.equals(legacyTypeName, that.legacyTypeName) + && Objects.equals(legacySubTypeName, that.legacySubTypeName) && Objects.equals(mLegacyExtraInfo, that.mLegacyExtraInfo) && excludeLocalRouteVpn == that.excludeLocalRouteVpn && mVpnRequiresValidation == that.mVpnRequiresValidation; @@ -514,8 +517,8 @@ public final class NetworkAgentConfig implements Parcelable { public int hashCode() { return Objects.hash(allowBypass, explicitlySelected, acceptUnvalidated, acceptPartialConnectivity, provisioningNotificationDisabled, subscriberId, - skip464xlat, legacyType, legacyTypeName, mLegacyExtraInfo, excludeLocalRouteVpn, - mVpnRequiresValidation); + skip464xlat, legacyType, legacySubType, legacyTypeName, legacySubTypeName, + mLegacyExtraInfo, excludeLocalRouteVpn, mVpnRequiresValidation); } @Override @@ -529,8 +532,10 @@ public final class NetworkAgentConfig implements Parcelable { + ", subscriberId = '" + subscriberId + '\'' + ", skip464xlat = " + skip464xlat + ", legacyType = " + legacyType + + ", legacySubType = " + legacySubType + ", hasShownBroken = " + hasShownBroken + ", legacyTypeName = '" + legacyTypeName + '\'' + + ", legacySubTypeName = '" + legacySubTypeName + '\'' + ", legacyExtraInfo = '" + mLegacyExtraInfo + '\'' + ", excludeLocalRouteVpn = '" + excludeLocalRouteVpn + '\'' + ", vpnRequiresValidation = '" + mVpnRequiresValidation + '\''