From 32186b78cee485dfc0f8192a0a46d23ac0e71aa2 Mon Sep 17 00:00:00 2001 From: xylophone21 Date: Thu, 10 Feb 2022 11:24:20 +0800 Subject: [PATCH] fix android dns-sd subtype error, and fix manualcode code pair search issue --- .../java/chip/platform/NsdManagerServiceResolver.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java index 02c0b9662c742c..55f4a7a7210b92 100644 --- a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java +++ b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java @@ -127,7 +127,13 @@ public void publish( String[] subTypes) { NsdServiceInfo serviceInfo = new NsdServiceInfo(); serviceInfo.setServiceName(serviceName); - serviceInfo.setServiceType(type); + + StringBuilder sb = new StringBuilder(type); + for (String subType:subTypes) { + sb.append(","+subType); + } + serviceInfo.setServiceType(sb.toString()); + serviceInfo.setPort(port); Log.i(TAG, "publish serviceName=" + serviceName + " type=" + type + " port=" + port); int cnt = Math.min(textEntriesDatas.length, textEntriesKeys.length);