legacy: Remove #SDP_RAW_DATA_INCLUDED

Bug: 191555414
Tag: #refactor
Test: gd/cert/run

Change-Id: I5018b5403a29401d120c92be959f9eec9304097c
diff --git a/system/btif/src/stack_manager.cc b/system/btif/src/stack_manager.cc
index 1e91024..95b4b57 100644
--- a/system/btif/src/stack_manager.cc
+++ b/system/btif/src/stack_manager.cc
@@ -84,6 +84,14 @@
 #error "*** Conditional Compilation Directive error"
 #endif
 
+#if SDP_RAW_DATA_INCLUDED != TRUE
+// Once SDP_RAW_DATA_INCLUDED is no longer exposed via bt_target.h
+// this check and error statement may be removed.
+#warning \
+    "#define SDP_RAW_DATA_INCLUDED preprocessor compilation flag is unsupported"
+#error "*** Conditional Compilation Directive error"
+#endif
+
 void main_thread_shut_down();
 void main_thread_start_up();
 void BTA_dm_on_hw_on();
diff --git a/system/stack/include/sdp_api.h b/system/stack/include/sdp_api.h
index 588e421..cdbf004 100644
--- a/system/stack/include/sdp_api.h
+++ b/system/stack/include/sdp_api.h
@@ -160,12 +160,10 @@
   uint16_t num_attr_filters; /* Number of attribute filters  */
   uint16_t attr_filters[SDP_MAX_ATTR_FILTERS]; /* Attributes to filter */
   uint8_t* p_free_mem; /* Pointer to free memory       */
-#if (SDP_RAW_DATA_INCLUDED == TRUE)
   uint8_t*
       raw_data; /* Received record from server. allocated/released by client  */
   uint32_t raw_size; /* size of raw_data */
   uint32_t raw_used; /* length of raw_data used */
-#endif
 } tSDP_DISCOVERY_DB;
 
 /* This structure is used to add protocol lists and find protocol elements */
diff --git a/system/stack/sdp/sdp_discovery.cc b/system/stack/sdp/sdp_discovery.cc
index ad6c173..510e811 100644
--- a/system/stack/sdp/sdp_discovery.cc
+++ b/system/stack/sdp/sdp_discovery.cc
@@ -334,7 +334,6 @@
  *                          false if not copied
  *
  ******************************************************************************/
-#if (SDP_RAW_DATA_INCLUDED == TRUE)
 static bool sdp_copy_raw_data(tCONN_CB* p_ccb, bool offset) {
   unsigned int cpy_len, rem_len;
   uint32_t list_len;
@@ -376,7 +375,6 @@
   }
   return true;
 }
-#endif
 
 /*******************************************************************************
  *
@@ -426,7 +424,6 @@
       }
       cont_request_needed = true;
     } else {
-#if (SDP_RAW_DATA_INCLUDED == TRUE)
       SDP_TRACE_WARNING("process_service_attr_rsp");
       if (!sdp_copy_raw_data(p_ccb, false)) {
         SDP_TRACE_ERROR("sdp_copy_raw_data failed");
@@ -434,8 +431,6 @@
         return;
       }
 
-#endif
-
       /* Save the response in the database. Stop on any error */
       if (!save_attr_seq(p_ccb, &p_ccb->rsp_list[0],
                          &p_ccb->rsp_list[p_ccb->list_len])) {
@@ -628,13 +623,11 @@
 /* We now have the full response, which is a sequence of sequences */
 /*******************************************************************/
 
-#if (SDP_RAW_DATA_INCLUDED == TRUE)
   if (!sdp_copy_raw_data(p_ccb, true)) {
     LOG_ERROR("sdp_copy_raw_data failed");
     sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER);
     return;
   }
-#endif
 
   p = &p_ccb->rsp_list[0];