[AWARE] Remove support for vendor-specific attributes

Vendor-specific attribute support API is not fully functional or
thought out. The Tx portion is working but the Rx portion requires
additional configuration to prevent spamming the framework with all
vendor-specific attributes.

Remove until full solution is designed.

Bug: 35193235
Test: unit tests and integration (sl4a) tests.
Change-Id: I31a601af3b2c1f9f736130ce00abf73c55ac086a
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 7464b81..691f913 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -1177,30 +1177,6 @@
   return true;
 }
 
-bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
-    const NanBeaconSdfPayloadRequest& hidl_request,
-    legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
-  if (!legacy_request) {
-    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: legacy_request is null";
-    return false;
-  }
-  memset(legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
-
-  legacy_request->vsa.payload_transmit_flag = hidl_request.transmitInNext16dws ? 1 : 0;
-  legacy_request->vsa.tx_in_discovery_beacon = hidl_request.transmitInDiscoveryBeacon;
-  legacy_request->vsa.tx_in_sync_beacon = hidl_request.transmitInSyncBeacon;
-  legacy_request->vsa.tx_in_service_discovery = hidl_request.transmitInServiceDiscoveryFrame;
-  legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
-  legacy_request->vsa.vsa_len = hidl_request.vsa.size();
-  if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
-    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: vsa_len too long";
-    return false;
-  }
-  memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
-
-  return true;
-}
-
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
     const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
@@ -1352,26 +1328,6 @@
   return true;
 }
 
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
-    NanBeaconSdfPayloadInd* hidl_ind) {
-  if (!hidl_ind) {
-    LOG(ERROR) << "convertLegacyNanBeaconSdfPayloadIndToHidl: hidl_ind is null";
-    return false;
-  }
-  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
-  hidl_ind->isVsaReceived = legacy_ind.is_vsa_received == 1;
-  hidl_ind->vsaReceivedOnFrames = legacy_ind.vsa.vsa_received_on;
-  hidl_ind->vsaVendorOui = legacy_ind.vsa.vendor_oui;
-  hidl_ind->vsa = std::vector<uint8_t>(legacy_ind.vsa.vsa,
-        legacy_ind.vsa.vsa + legacy_ind.vsa.attr_len);
-  hidl_ind->isBeaconSdfPayloadReceived = legacy_ind.is_beacon_sdf_payload_received == 1;
-  hidl_ind->beaconSdfPayloadData = std::vector<uint8_t>(legacy_ind.data.frame_data,
-        legacy_ind.data.frame_data + legacy_ind.data.frame_len);
-
-  return true;
-}
-
 bool convertLegacyNanDataPathRequestIndToHidl(
     const legacy_hal::NanDataPathRequestInd& legacy_ind,
     NanDataPathRequestInd* hidl_ind) {
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 14bc77d..490dcae 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -110,9 +110,6 @@
 bool convertHidlNanTransmitFollowupRequestToLegacy(
     const NanTransmitFollowupRequest& hidl_request,
     legacy_hal::NanTransmitFollowupRequest* legacy_request);
-bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
-    const NanBeaconSdfPayloadRequest& hidl_request,
-    legacy_hal::NanBeaconSdfPayloadRequest* legacy_request);
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
     const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request);
@@ -135,9 +132,6 @@
 bool convertLegacyNanDataPathConfirmIndToHidl(
     const legacy_hal::NanDataPathConfirmInd& legacy_ind,
     NanDataPathConfirmInd* hidl_ind);
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
-    NanBeaconSdfPayloadInd* hidl_ind);
 
 // RTT controller conversion methods.
 bool convertHidlVectorOfRttConfigToLegacy(
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 333fac7..05479e7 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -120,14 +120,6 @@
         }
         break;
      }
-    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
-        for (const auto& callback : shared_ptr_this->event_callbacks_) {
-          if (!callback->notifyBeaconSdfPayloadResponse(id, wifiNanStatus).isOk()) {
-            LOG(ERROR) << "Failed to invoke the callback";
-          }
-        }
-        break;
-     }
     case legacy_hal::NAN_GET_CAPABILITIES: {
         NanCapabilities hidl_struct;
         if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl(
@@ -183,6 +175,8 @@
         }
         break;
     }
+    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD:
+        /* fall through */
     case legacy_hal::NAN_RESPONSE_TCA:
         /* fall through */
     case legacy_hal::NAN_RESPONSE_STATS:
@@ -402,24 +396,8 @@
   };
 
   callback_handlers.on_event_beacon_sdf_payload = [weak_ptr_this](
-        const legacy_hal::NanBeaconSdfPayloadInd& msg) {
-      const auto shared_ptr_this = weak_ptr_this.promote();
-      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
-        LOG(ERROR) << "Callback invoked on an invalid object";
-        return;
-      }
-      NanBeaconSdfPayloadInd hidl_struct;
-      if (!hidl_struct_util::convertLegacyNanBeaconSdfPayloadIndToHidl(
-            msg, &hidl_struct)) {
-          LOG(ERROR) << "Failed to convert nan capabilities response";
-          return;
-      }
-
-      for (const auto& callback : shared_ptr_this->event_callbacks_) {
-        if (!callback->eventBeaconSdfPayload(hidl_struct).isOk()) {
-            LOG(ERROR) << "Failed to invoke the callback";
-        }
-      }
+        const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) {
+      LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called";
   };
 
   legacy_hal::wifi_error legacy_status =
@@ -621,18 +599,6 @@
                          ndpInstanceId);
 }
 
-Return<void> WifiNanIface::beaconSdfPayloadRequest(
-    uint16_t cmd_id,
-    const NanBeaconSdfPayloadRequest& msg,
-    beaconSdfPayloadRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::beaconSdfPayloadRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
 std::pair<WifiStatus, std::string> WifiNanIface::getNameInternal() {
   return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -783,16 +749,6 @@
   free(legacy_msg);
   return createWifiStatusFromLegacyError(legacy_status);
 }
-WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal(
-    uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg) {
-  legacy_hal::NanBeaconSdfPayloadRequest legacy_msg;
-  if (!hidl_struct_util::convertHidlNanBeaconSdfPayloadRequestToLegacy(msg, &legacy_msg)) {
-    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
-  }
-  legacy_hal::wifi_error legacy_status =
-      legacy_hal_.lock()->nanBeaconSdfPayloadRequest(cmd_id, legacy_msg);
-  return createWifiStatusFromLegacyError(legacy_status);
-}
 
 }  // namespace implementation
 }  // namespace V1_0
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index 4fae3df..af838c5 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -87,9 +87,6 @@
   Return<void> terminateDataPathRequest(uint16_t cmd_id,
                                         uint32_t ndpInstanceId,
                                         terminateDataPathRequest_cb hidl_status_cb) override;
-  Return<void> beaconSdfPayloadRequest(uint16_t cmd_id,
-                                       const NanBeaconSdfPayloadRequest& msg,
-                                       beaconSdfPayloadRequest_cb hidl_status_cb) override;
 
  private:
   // Corresponding worker functions for the HIDL methods.
@@ -121,8 +118,6 @@
       uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg);
   WifiStatus terminateDataPathRequestInternal(
       uint16_t cmd_id, uint32_t ndpInstanceId);
-  WifiStatus beaconSdfPayloadRequestInternal(
-      uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
 
   std::string ifname_;
   std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;