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

Commit 3a6a6fcd authored by Henri Chataing's avatar Henri Chataing
Browse files

Flags 24Q4: Remove the flag avrcp_connect_a2dp_with_delay

Bug: 328406945
Test: m com.android.btservices
Flag: com.android.bluetooth.flags.avrcp_connect_a2dp_with_delay
Change-Id: I203cfe128c8c55a75eafb4b60d237e9af0c639ad
parent 3fc0ce05
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ from typing import Optional, Tuple

logger = logging.getLogger(__name__)

AVRCP_CONNECT_A2DP_WITH_DELAY = 'com.android.bluetooth.flags.avrcp_connect_a2dp_with_delay'
AVDTP_HANDLE_SUSPEND_CFM_BAD_STATE = 'com.android.bluetooth.flags.avdt_handle_suspend_cfm_bad_state'


@@ -280,13 +279,6 @@ class A2dpTest(base_test.BaseTestClass): # type: ignore[misc]
        3. Check AVDTP status on RD1
        """

        # Enable AVRCP connect A2DP delayed feature
        for server in self.devices._servers:
            if isinstance(server, AndroidPandoraServer):
                server.device.adb.shell(['device_config override bluetooth', AVRCP_CONNECT_A2DP_WITH_DELAY,
                                         'true'])  # type: ignore
                break

        # Connect and pair RD1.
        ref1_dut, dut_ref1 = await asyncio.gather(
            initiate_pairing(self.ref1, self.dut.address),
+0 −10
Original line number Diff line number Diff line
@@ -11,16 +11,6 @@ flag {
    }
}

flag {
    name: "avrcp_connect_a2dp_with_delay"
    namespace: "bluetooth"
    description: "When peer device connects AVRCP but not A2DP we initiate A2DP connection after some time delay"
    bug: "328406945"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "browsing_refactor"
    namespace: "bluetooth"
+1 −1
Original line number Diff line number Diff line
@@ -2810,7 +2810,7 @@ static void btif_av_source_initiate_av_open_timer_timeout(void* data) {
  BtifAvPeer* peer = reinterpret_cast<BtifAvPeer*>(data);
  bool device_connected = false;

  if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay() && is_new_avrcp_enabled()) {
  if (is_new_avrcp_enabled()) {
    // check if device is connected
    if (bluetooth::avrcp::AvrcpService::Get() != nullptr) {
      device_connected =
+2 −4
Original line number Diff line number Diff line
@@ -406,10 +406,8 @@ void ConnectionHandler::AcceptorControlCb(uint8_t handle, uint8_t event, uint16_
      // as this one which will be closed when the device is disconnected.
      AvrcpConnect(false, RawAddress::kAny);

      if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) {
      // Check peer audio role: src or sink and connect A2DP after 3 seconds
      SdpLookupAudioRole(handle);
      }
    } break;

    case AVRC_CLOSE_IND_EVT: {
+8 −16
Original line number Diff line number Diff line
@@ -208,10 +208,8 @@ TEST_F(AvrcpConnectionHandlerTest, remoteDeviceConnectionTest) {
  // device connects.
  EXPECT_CALL(mock_avrcp_, OpenBrowse(1, AVCT_ROLE_ACCEPTOR)).Times(1);

  if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) {
  // Set an expectation that SDP for audio will be performed
  EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1);
  }

  // Call the callback with a message saying that a remote device has connected
  conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny);
@@ -248,10 +246,8 @@ TEST_F(AvrcpConnectionHandlerTest, noAbsoluteVolumeTest) {
  tAVRC_FIND_CBACK sdp_cb;
  SetUpSdp(&sdp_cb, false, false);

  if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) {
  // Set an expectation that SDP for audio will be performed
  EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1);
  }

  EXPECT_CALL(mock_volume_, DeviceConnected(RawAddress::kAny)).Times(1);

@@ -292,10 +288,8 @@ TEST_F(AvrcpConnectionHandlerTest, absoluteVolumeTest) {
  tAVRC_FIND_CBACK sdp_cb;
  SetUpSdp(&sdp_cb, false, true);

  if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) {
  // Set an expectation that SDP for audio will be performed
  EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1);
  }

  // Call the callback with a message saying that a remote device has connected
  conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny);
@@ -324,10 +318,8 @@ TEST_F(AvrcpConnectionHandlerTest, disconnectTest) {
                                            &mock_volume_));
  connection_handler_ = ConnectionHandler::Get();

  if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay()) {
  // Set an expectation that SDP for audio will be performed
  EXPECT_CALL(mock_a2dp_, find_audio_sink_service(_, _)).Times(1);
  }

  // Call the callback with a message saying that a remote device has connected
  conn_cb.ctrl_cback.Run(1, AVRC_OPEN_IND_EVT, 0, &RawAddress::kAny);