From d97da87b472a82ad3c2ca51a6c3bcfde12f17178 Mon Sep 17 00:00:00 2001 From: Youngho Yoon <34558998+yhoyoon@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:46:24 +0900 Subject: [PATCH] [Android] Change default val of udpListenPort to 0 (#29875) This commit changes the default value of the UDP listen port used in Android platform's ControllerParams from 5541 to 0. Since the default value of UDP listen port was 5541, if multiple matter applications using default settings are run on one matter device, UDP listen port conflict occurs. If we set the UDP listen port to 0, port collisions can be avoided because the port is bound randomly. Although matter applications can avoid conflicts by setting a UDP listen port, it is better to set this to its default value of 0 so that matter applications that use the default settings can avoid conflicts. Signed-off-by: Youngho Yoon Signed-off-by: Charles Kim Signed-off-by: Hunsup Jung Signed-off-by: sanghyukko Signed-off-by: Jaehoon You Signed-off-by: Kyu-Wook Lim --- .../java/src/chip/devicecontroller/ControllerParams.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controller/java/src/chip/devicecontroller/ControllerParams.java b/src/controller/java/src/chip/devicecontroller/ControllerParams.java index fdf09c0080d6ca..c52147f73b83b1 100644 --- a/src/controller/java/src/chip/devicecontroller/ControllerParams.java +++ b/src/controller/java/src/chip/devicecontroller/ControllerParams.java @@ -23,8 +23,6 @@ public final class ControllerParams { @Nullable private final byte[] ipk; private final long adminSubject; - private static final int LEGACY_GLOBAL_CHIP_PORT = 5540; - /** @param udpListenPort the UDP listening port, or 0 to pick any available port. */ private ControllerParams(Builder builder) { this.fabricId = builder.fabricId; @@ -132,7 +130,7 @@ public static Builder newBuilder(OperationalKeyConfig operationalKeyConfig) { /** Builder for {@link ControllerParams}. */ public static class Builder { private long fabricId = 1; - private int udpListenPort = LEGACY_GLOBAL_CHIP_PORT + 1; + private int udpListenPort = 0; private int controllerVendorId = 0xFFFF; private int failsafeTimerSeconds = 30; private int caseFailsafeTimerSeconds = 0;