OSDN Git Service

[AWARE] Data-path negotiation update
authorEtan Cohen <etancohen@google.com>
Wed, 22 Feb 2017 20:54:20 +0000 (12:54 -0800)
committerEtan Cohen <etancohen@google.com>
Fri, 24 Feb 2017 23:25:10 +0000 (15:25 -0800)
Data-path has two negotiation modes controlled during a
discovery session configuration as auto-accept or not (in
which case an event to framework is triggered).

Bug: 33552694
Test: unit tests and integration (sl4a) tests
Change-Id: I129ee48554daddb606bfd2c20ffdd867a6d998e0

wifi/1.0/default/hidl_struct_util.cpp
wifi/1.0/default/wifi_nan_iface.cpp
wifi/1.0/types.hal

index c498206..726f011 100644 (file)
@@ -973,6 +973,8 @@ bool convertHidlNanPublishRequestToLegacy(
   legacy_request->range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT;
   legacy_request->publish_type = (legacy_hal::NanPublishType) hidl_request.publishType;
   legacy_request->tx_type = (legacy_hal::NanTxType) hidl_request.txType;
+  legacy_request->service_responder_policy = hidl_request.autoAcceptDataPathRequests ?
+        legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE;
 
   return true;
 }
index 68be2a7..6977fc0 100644 (file)
@@ -166,6 +166,7 @@ WifiNanIface::WifiNanIface(
             LOG(ERROR) << "Failed to invoke the callback";
           }
         }
+        break;
     }
     case legacy_hal::NAN_DP_END: {
         for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
index 5ffb55c..3b2f25b 100644 (file)
@@ -1062,6 +1062,13 @@ struct NanPublishRequest {
    * peer.
    */
   NanTxType txType;
+  /**
+   * Specifies whether data-path requests |IWifiNanIfaceEventCallback.eventDataPathRequest| (in
+   * the context of this discovery session) are automatically accepted (if true) - in which case
+   * the Responder must not call the |IWifiNanIface.respondToDataPathIndicationRequest| method and
+   * the device must automatically accept the data-path request and complete the negotiation.
+   */
+  bool autoAcceptDataPathRequests;
 };
 
 /**