Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e49a5b02 authored by Zach Johnson's avatar Zach Johnson
Browse files

what on earth

this has been here since this code was put into AOSP

"oh hey, PAN_Register changes discoverable and connectable, let's work
around it by saving the initial values and then restoring them after."

anyways, I checked PAN_Register only sets initial state & registers with
l2cap.

this looks like a vestige of early PAN, probably from BTA days when this
was on feature phones they needed a way to make your phone discoverable
so you could use PAN.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: I51c3b864b5c7c4847bcc2dfb84e55b6191146778
parent 4d36d759
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -299,12 +299,6 @@ static bool bta_pan_has_multiple_connections(uint8_t app_id) {
 ******************************************************************************/
void bta_pan_enable(tBTA_PAN_DATA* p_data) {
  tPAN_REGISTER reg_data;
  uint16_t initial_discoverability;
  uint16_t initial_connectability;
  uint16_t d_window;
  uint16_t d_interval;
  uint16_t c_window;
  uint16_t c_interval;

  bta_pan_cb.p_cback = p_data->api_enable.p_cback;

@@ -316,18 +310,8 @@ void bta_pan_enable(tBTA_PAN_DATA* p_data) {
  reg_data.pan_mfilt_ind_cb = bta_pan_mfilt_ind_cback;
  reg_data.pan_tx_data_flow_cb = bta_pan_data_flow_cb;

  /* read connectability and discoverability settings.
  Pan profile changes the settings. We have to change it back to
  be consistent with other bta subsystems */
  initial_connectability = BTM_ReadConnectability(&c_window, &c_interval);
  initial_discoverability = BTM_ReadDiscoverability(&d_window, &d_interval);

  PAN_Register(&reg_data);

  /* set it back to original value */
  BTM_SetDiscoverability(initial_discoverability, d_window, d_interval);
  BTM_SetConnectability(initial_connectability, c_window, c_interval);

  bta_pan_cb.flow_mask = bta_pan_co_init(&bta_pan_cb.q_level);
  bta_pan_cb.p_cback(BTA_PAN_ENABLE_EVT, NULL);
}
+0 −3
Original line number Diff line number Diff line
@@ -55,9 +55,6 @@ using bluetooth::Uuid;
 *
 ******************************************************************************/
void PAN_Register(tPAN_REGISTER* p_register) {
  BTM_SetDiscoverability(BTM_GENERAL_DISCOVERABLE, 0, 0);
  BTM_SetConnectability(BTM_CONNECTABLE, 0, 0);

  pan_register_with_bnep();

  if (!p_register) return;