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

Commit 6059d6c9 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Flag: Remove rnr_cancel_before_event_race am: 5978a926

parents 11203682 5978a926
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "rnr_cancel_before_event_race"
    namespace: "bluetooth"
    description: "Address race condition when rnr cancel and event arrive close together"
    bug: "316037290"
}

flag {
    name: "rnr_present_during_service_discovery"
    namespace: "bluetooth"
+5 −13
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ struct RemoteNameRequestModule::impl {
  }

  void actually_cancel_remote_name_request(Address address) {
    if (com::android::bluetooth::flags::rnr_cancel_before_event_race()) {
    if (pending_) {
      log::info("Cancelling remote name request to {}", address.ToRedactedStringForLogging());
      hci_layer_->EnqueueCommand(
@@ -165,13 +164,6 @@ struct RemoteNameRequestModule::impl {
          "Ignoring cancel RNR as RNR event already received to {}",
          address.ToRedactedStringForLogging());
    }
    } else {
      log::assert_that(pending_ == true, "assert failed: pending_ == true");
      log::info("Cancelling remote name request to {}", address.ToRedactedStringForLogging());
      hci_layer_->EnqueueCommand(
          RemoteNameRequestCancelBuilder::Create(address),
          handler_->BindOnceOn(this, &impl::check_cancel_status, address));
    }
  }

  void on_remote_host_supported_features_notification(EventView view) {
+1 −6
Original line number Diff line number Diff line
@@ -659,12 +659,7 @@ TEST_F(RemoteNameRequestModuleTest, FailToSendCommandThenDequeueNext) {
  EXPECT_EQ(rnr_command.GetBdAddr(), address2);
}

#define MY_PACKAGE com::android::bluetooth::flags

TEST_F_WITH_FLAGS(
    RemoteNameRequestModuleTest,
    CancelJustWhenRNREventReturns,
    REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(MY_PACKAGE, rnr_cancel_before_event_race))) {
TEST_F(RemoteNameRequestModuleTest, CancelJustWhenRNREventReturns) {
  auto promise = std::promise<std::tuple<ErrorCode, std::array<uint8_t, 248>>>{};
  auto future = promise.get_future();