OSDN Git Service

BTM_ReadDiscoverability is never used now
authorZach Johnson <zachoverflow@google.com>
Wed, 19 Aug 2020 18:51:57 +0000 (11:51 -0700)
committerZach Johnson <zachoverflow@google.com>
Wed, 19 Aug 2020 18:51:57 +0000 (11:51 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I96781ecd6ebd149b2a6e5d91b803f49cc675db9c

main/shim/btm_api.cc
main/shim/btm_api.h
stack/btm/btm_inq.cc
stack/include/btm_api.h
stack/test/ble_advertiser_test.cc

index 0a54c8b..39c413c 100644 (file)
@@ -451,17 +451,6 @@ tBTM_STATUS bluetooth::shim::BTM_SetInquiryMode(uint8_t inquiry_mode) {
   return BTM_SUCCESS;
 }
 
-uint16_t bluetooth::shim::BTM_ReadDiscoverability(uint16_t* p_window,
-                                                  uint16_t* p_interval) {
-  DiscoverabilityState state =
-      Stack::GetInstance()->GetBtm()->GetClassicDiscoverabilityState();
-
-  if (p_interval) *p_interval = state.interval;
-  if (p_window) *p_window = state.window;
-
-  return state.mode;
-}
-
 tBTM_STATUS bluetooth::shim::BTM_SetConnectability(uint16_t page_mode,
                                                    uint16_t window,
                                                    uint16_t interval) {
index 94e4bd3..0ad78af 100644 (file)
@@ -120,22 +120,6 @@ tBTM_STATUS BTM_SetInquiryMode(uint8_t mode);
 
 /*******************************************************************************
  *
- * Function         BTM_ReadDiscoverability
- *
- * Description      This function is called to read the current discoverability
- *                  mode of the device.
- *
- * Output Params:   p_window - current inquiry scan duration
- *                  p_interval - current inquiry scan interval
- *
- * Returns          BTM_NON_DISCOVERABLE, BTM_LIMITED_DISCOVERABLE, or
- *                  BTM_GENERAL_DISCOVERABLE
- *
- ******************************************************************************/
-uint16_t BTM_ReadDiscoverability(uint16_t* p_window, uint16_t* p_interval);
-
-/*******************************************************************************
- *
  * Function         BTM_SetConnectability
  *
  * Description      This function is called to set the device into or out of
index 535832a..c25319b 100644 (file)
@@ -309,33 +309,6 @@ tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) {
 
 /*******************************************************************************
  *
- * Function         BTM_ReadDiscoverability
- *
- * Description      This function is called to read the current discoverability
- *                  mode of the device.
- *
- * Output Params:   p_window - current inquiry scan duration
- *                  p_interval - current inquiry scan interval
- *
- * Returns          BTM_NON_DISCOVERABLE, BTM_LIMITED_DISCOVERABLE, or
- *                  BTM_GENERAL_DISCOVERABLE
- *
- ******************************************************************************/
-uint16_t BTM_ReadDiscoverability(uint16_t* p_window, uint16_t* p_interval) {
-  if (bluetooth::shim::is_gd_shim_enabled()) {
-    return bluetooth::shim::BTM_ReadDiscoverability(p_window, p_interval);
-  }
-
-  BTM_TRACE_API("BTM_ReadDiscoverability");
-  if (p_window) *p_window = btm_cb.btm_inq_vars.inq_scan_window;
-
-  if (p_interval) *p_interval = btm_cb.btm_inq_vars.inq_scan_period;
-
-  return (btm_cb.btm_inq_vars.discoverable_mode);
-}
-
-/*******************************************************************************
- *
  * Function         BTM_SetConnectability
  *
  * Description      This function is called to set the device into or out of
index c1b436f..444f92d 100644 (file)
@@ -253,22 +253,6 @@ tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode);
 
 /*******************************************************************************
  *
- * Function         BTM_ReadDiscoverability
- *
- * Description      This function is called to read the current discoverability
- *                  mode of the device.
- *
- * Output Params:   p_window - current inquiry scan duration
- *                  p_interval - current inquiry scan interval
- *
- * Returns          BTM_NON_DISCOVERABLE, BTM_LIMITED_DISCOVERABLE, or
- *                  BTM_GENERAL_DISCOVERABLE
- *
- ******************************************************************************/
-uint16_t BTM_ReadDiscoverability(uint16_t* p_window, uint16_t* p_interval);
-
-/*******************************************************************************
- *
  * Function         BTM_StartInquiry
  *
  * Description      This function is called to start an inquiry.
index 98142dd..8d5ff1f 100644 (file)
@@ -44,9 +44,6 @@ const int num_adv_instances = 16;
  * whole stack. They will be removed, or changed into mocks one by one in the
  * future, as the refactoring progresses */
 bool BTM_BleLocalPrivacyEnabled() { return true; }
-uint16_t BTM_ReadDiscoverability(uint16_t* p_window, uint16_t* p_interval) {
-  return true;
-}
 void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address) {
 }
 void btm_gen_resolvable_private_addr(
@@ -1113,4 +1110,4 @@ TEST_F(BleAdvertisingManagerTest, test_recompute_timeout) {
   testRecomputeTimeout1();
   testRecomputeTimeout2();
   testRecomputeTimeout3();
-}
\ No newline at end of file
+}