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

Commit 6cb3766c authored by Henri Chataing's avatar Henri Chataing Committed by Charlie Boutier
Browse files

RootCanal: Local extended inquiry response sent in inquiry

The inquiry was reporting the local extended inquiry response
to the host when an extended inquiry report was found.
This would cause the host device to report found devices
with the same name as the local device...

Bug: 283333903
Test: atest pts-bot:OPP
Change-Id: I680ef2af8b913899791b5f117cf900cf55aa1b20
parent 05d6487d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -58,7 +58,10 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable {
  private val INCOMING_FILE_TITLE = "Incoming file"
  private val INCOMING_FILE_WAIT_TIMEOUT = 2000L

  private val BT_DEVICE_SELECT_WAIT_TIMEOUT = 3000L
  // PTS does not configure the Extended Inquiry Response with the
  // device name; the device will be found after the Inquiry Timeout
  // (12.8sec) has elapsed.
  private val BT_DEVICE_SELECT_WAIT_TIMEOUT = 20000L
  private val IMAGE_FILE_NAME = "OPP_TEST_IMAGE.bmp"

  private val bluetoothManager = context.getSystemService(BluetoothManager::class.java)!!
@@ -164,7 +167,7 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable {
    var selectJob =
      scope.async {
        device
          .wait(Until.findObject(By.textContains("Cuttlefish")), BT_DEVICE_SELECT_WAIT_TIMEOUT)
          .wait(Until.findObject(By.textContains("PTS")), BT_DEVICE_SELECT_WAIT_TIMEOUT)
          .click()
      }
    selectJob.await()
+1 −1
Original line number Diff line number Diff line
@@ -2765,7 +2765,7 @@ void LinkLayerController::IncomingInquiryResponsePacket(
              inquiry_response.GetPageScanRepetitionMode()),
          inquiry_response.GetClassOfDevice(),
          inquiry_response.GetClockOffset(), inquiry_response.GetRssi(),
          extended_inquiry_response_));
          inquiry_response.GetExtendedInquiryResponse()));
    } break;
    default:
      LOG_WARN("Unhandled Incoming Inquiry Response of type %d",