From f7939fa8d1c4566d056a8501e610c8fe18ac98f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Thu, 18 May 2023 03:44:27 +0000 Subject: [PATCH] LinkProperties: use ordered comparison for P-CSCFs - only on U+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to make sure a mainline update doesn't break devices in the field Test: TreeHugger Bug: 268479036 Signed-off-by: Maciej Żenczykowski Change-Id: Iadcd861509d31b3ed6352d452a159cd89af479dd --- framework/src/android/net/LinkProperties.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/android/net/LinkProperties.java b/framework/src/android/net/LinkProperties.java index 4f7ac30b5e..9fb9bc667d 100644 --- a/framework/src/android/net/LinkProperties.java +++ b/framework/src/android/net/LinkProperties.java @@ -1456,8 +1456,13 @@ public final class LinkProperties implements Parcelable { * @hide */ public boolean isIdenticalPcscfs(@NonNull LinkProperties target) { - // list order is important, compare one by one - return target.getPcscfServers().equals(mPcscfs); + // Per 3GPP TS 24.229, B.2.2.1 PDP context activation and P-CSCF discovery + // list order is important, so on U+ compare one by one + if (SdkLevel.isAtLeastU()) return target.getPcscfServers().equals(mPcscfs); + // but for safety old behaviour on pre-U: + Collection targetPcscfs = target.getPcscfServers(); + return (mPcscfs.size() == targetPcscfs.size()) ? + mPcscfs.containsAll(targetPcscfs) : false; } /**