diff --git a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java index f5bb8553466d4e..02c0b9662c742c 100644 --- a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java +++ b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java @@ -130,6 +130,12 @@ public void publish( serviceInfo.setServiceType(type); serviceInfo.setPort(port); Log.i(TAG, "publish serviceName=" + serviceName + " type=" + type + " port=" + port); + int cnt = Math.min(textEntriesDatas.length, textEntriesKeys.length); + for (int i = 0; i < cnt; i++) { + String value = new String(textEntriesDatas[i]); + serviceInfo.setAttribute(textEntriesKeys[i], value); + Log.i(TAG, " " + textEntriesKeys[i] + "=" + value); + } NsdManager.RegistrationListener registrationListener = new NsdManager.RegistrationListener() {