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

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

Who are we kidding...we can't reset state in process safely

Getting out of test mode now results in a hard stack restart.

This means we can clean up the code that assumes we need to.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9f3db5959b35213fc88d07d444d81de6783e82c0
parent 209ed09a
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -89,11 +89,6 @@ void BTA_EnableTestMode(void) {
                    base::Bind(base::IgnoreResult(BTM_EnableTestMode)));
}

/** Disable bluetooth device under test mode */
void BTA_DisableTestMode(void) {
  do_in_main_thread(FROM_HERE, base::Bind(BTM_DeviceReset));
}

/** This function sets the Bluetooth name of local device */
void BTA_DmSetDeviceName(char* p_name) {
  std::vector<uint8_t> name(BD_NAME_LEN);
+0 −12
Original line number Diff line number Diff line
@@ -996,18 +996,6 @@ extern tBTA_STATUS BTA_DisableBluetooth(void);
 ******************************************************************************/
extern void BTA_EnableTestMode(void);

/*******************************************************************************
 *
 * Function         BTA_DisableTestMode
 *
 * Description      Disable bluetooth device under test mode
 *
 *
 * Returns          None
 *
 ******************************************************************************/
extern void BTA_DisableTestMode(void);

/*******************************************************************************
 *
 * Function         BTA_DmSetDeviceName
+2 −1
Original line number Diff line number Diff line
@@ -515,7 +515,8 @@ bt_status_t btif_dut_mode_configure(uint8_t enable) {
  if (enable == 1) {
    BTA_EnableTestMode();
  } else {
    BTA_DisableTestMode();
    // Can't do in process reset anyways - just quit
    kill(getpid(), SIGKILL);
  }
  return BT_STATUS_SUCCESS;
}