From 8ad38f0f6c161a01495735aa1c77cc80b383f688 Mon Sep 17 00:00:00 2001 From: "Philip P. Moltmann" Date: Mon, 18 Apr 2016 16:23:06 -0700 Subject: [PATCH] DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. Fixes: 28530428 (cherry picked from commit 79a3c031a09ff02e1f22c87024ae220c32e04c6c) (cherry picked from commit 2838d9bb56be242278719dd396829b4f391268b0) Change-Id: Ib8f8da947af804c8b203928e57ed6a8aedbf0684 --- core/java/android/net/nsd/NsdManager.java | 10 +++++----- core/java/android/net/nsd/NsdServiceInfo.java | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/java/android/net/nsd/NsdManager.java b/core/java/android/net/nsd/NsdManager.java index 86bd502826..33d12a3a3f 100644 --- a/core/java/android/net/nsd/NsdManager.java +++ b/core/java/android/net/nsd/NsdManager.java @@ -103,11 +103,11 @@ import com.android.internal.util.Protocol; * to {@link DiscoveryListener#onServiceFound} and a service lost is notified on * {@link DiscoveryListener#onServiceLost}. * - *

Once the peer application discovers the "Example" http srevice, and needs to receive data - * from the "Example" application, it can initiate a resolve with {@link #resolveService} to - * resolve the host and port details for the purpose of establishing a connection. A successful - * resolve is notified on {@link ResolveListener#onServiceResolved} and a failure is notified - * on {@link ResolveListener#onResolveFailed}. + *

Once the peer application discovers the "Example" http service, and either needs to read the + * attributes of the service or wants to receive data from the "Example" application, it can + * initiate a resolve with {@link #resolveService} to resolve the attributes, host, and port + * details. A successful resolve is notified on {@link ResolveListener#onServiceResolved} and a + * failure is notified on {@link ResolveListener#onResolveFailed}. * * Applications can reserve for a service type at * http://www.iana.org/form/ports-service. Existing services can be found at diff --git a/core/java/android/net/nsd/NsdServiceInfo.java b/core/java/android/net/nsd/NsdServiceInfo.java index 4a06fb1220..7b845be749 100644 --- a/core/java/android/net/nsd/NsdServiceInfo.java +++ b/core/java/android/net/nsd/NsdServiceInfo.java @@ -250,7 +250,8 @@ public final class NsdServiceInfo implements Parcelable { } /** - * Retrive attributes as a map of String keys to byte[] values. + * Retrieve attributes as a map of String keys to byte[] values. The attributes map is only + * valid for a resolved service. * *

The returned map is unmodifiable; changes must be made through {@link #setAttribute} and * {@link #removeAttribute}.