Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6538650e authored by Etan Cohen's avatar Etan Cohen
Browse files

[AWARE] Update PeerHandle doc to reflect good practice on usage

Update PeerHandle doc to relfect that while can be compared and hashed,
good practice will use an app level identifier.

Bug: 68931709
Test: 'make update-api' and reviewed generated doc
Change-Id: If6725e8854976d482ca18429a9b5352cff0baf93
parent ff43d08e
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -18,11 +18,20 @@ package android.net.wifi.aware;

/**
 * Opaque object used to represent a Wi-Fi Aware peer. Obtained from discovery sessions in
 * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List)}, used
 * when sending messages e,g, {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])},
 * {@link DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], java.util.List)} or
 * received messages in {@link DiscoverySessionCallback#onMessageReceived(PeerHandle, byte[])}, and
 * used when sending messages e,g, {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])},
 * or when configuring a network link to a peer, e.g.
 * {@link DiscoverySession#createNetworkSpecifierOpen(PeerHandle)} or
 * {@link DiscoverySession#createNetworkSpecifierPassphrase(PeerHandle, String)}.
 * <p>
 * Note that while a {@code PeerHandle} can be used to track a particular peer (i.e. you can compare
 * the values received from subsequent messages) - it is good practice not to rely on it. Instead
 * use an application level peer identifier encoded in the message,
 * {@link DiscoverySession#sendMessage(PeerHandle, int, byte[])}, and/or in the Publish
 * configuration's service-specific information field,
 * {@link PublishConfig.Builder#setServiceSpecificInfo(byte[])}, or match filter,
 * {@link PublishConfig.Builder#setMatchFilter(java.util.List)}.
 */
public class PeerHandle {
    /** @hide */