From f7908cb6ec5f1df061fd2bcaa659e7961a4c5cd1 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Tue, 23 May 2017 17:08:46 -0700 Subject: [PATCH] [AWARE] Clarify semantics of service discovery parameters On service discovery which happens on the subscriber we receive some information about the peer (the publisher): it's id, some arbitrary blob it's providing (ssi), and a "match filter". The match filter is the matching criteria (aside from service name) used to find a service. The semantics are clarified by this CL: - Unsolicited publish/passive subscriber: the publisher is active and broadcasting. We're getting the match filter which it advertises. No change. - Solicited publish/active subscriber: the publisher is silent and will only respond if it matches what the subscriber provides. In such a case we will never know it's exact criteria and therefore cannot provide it to the app. We're simply providing the local match criteria. This is a clarification/possible change from initial understanding. Bug: 36371061 Test: DiscoveryTest:test_positive_solicited_active_typical Change-Id: I7d989cf0dc2383d15e4df18c9c0ea079f0486d80 --- .../android/net/wifi/aware/DiscoverySessionCallback.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java b/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java index d8667e6cfcb69..115b86d156e50 100644 --- a/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java +++ b/wifi/java/android/net/wifi/aware/DiscoverySessionCallback.java @@ -100,7 +100,12 @@ public class DiscoverySessionCallback { * @param serviceSpecificInfo The service specific information (arbitrary * byte array) provided by the peer as part of its discovery * configuration. - * @param matchFilter The filter which resulted in this service discovery. + * @param matchFilter The filter which resulted in this service discovery. For + * {@link PublishConfig#PUBLISH_TYPE_UNSOLICITED}, + * {@link SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE} discovery sessions this is the publisher's + * match filter. For {@link PublishConfig#PUBLISH_TYPE_SOLICITED}, + * {@link SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE} discovery sessions this + * is the subscriber's match filter. */ public void onServiceDiscovered(PeerHandle peerHandle, byte[] serviceSpecificInfo, List matchFilter) {