Loading android/pandora/test/a2dp_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ from pandora.security_pb2 import LEVEL2 from threading import Thread from typing import Optional AVRCP_CONNECT_A2DP_DELAYED = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_delayed' AVRCP_CONNECT_A2DP_WITH_DELAY = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_with_delay' async def initiate_pairing(device, address) -> Connection: """Connect and pair a remote device.""" Loading Loading @@ -264,7 +264,7 @@ class A2dpTest(base_test.BaseTestClass): # type: ignore[misc] # Enable AVRCP connect A2DP delayed feature for server in self.devices._servers: if isinstance(server, AndroidPandoraServer): server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_DELAYED, 'true']) # type: ignore server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_WITH_DELAY, 'true']) # type: ignore break # Connect and pair RD1. Loading flags/avrcp.aconfig +4 −1 Original line number Diff line number Diff line Loading @@ -2,10 +2,13 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { name: "avrcp_connect_a2dp_delayed" 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 { Loading system/btif/src/btif_av.cc +1 −1 Original line number Diff line number Diff line Loading @@ -2854,7 +2854,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_delayed() && is_new_avrcp_enabled()) { if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay() && is_new_avrcp_enabled()) { // check if device is connected if (bluetooth::avrcp::AvrcpService::Get() != nullptr) { device_connected = Loading system/profile/avrcp/connection_handler.cc +1 −1 Original line number Diff line number Diff line Loading @@ -404,7 +404,7 @@ 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_delayed()) { 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); } Loading system/profile/avrcp/tests/avrcp_connection_handler_test.cc +4 −4 Original line number Diff line number Diff line Loading @@ -205,7 +205,7 @@ TEST_F(AvrcpConnectionHandlerTest, remoteDeviceConnectionTest) { // device connects. EXPECT_CALL(mock_avrcp_, OpenBrowse(1, AVCT_ACP)).Times(1); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -245,7 +245,7 @@ TEST_F(AvrcpConnectionHandlerTest, noAbsoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, false); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -289,7 +289,7 @@ TEST_F(AvrcpConnectionHandlerTest, absoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, true); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -321,7 +321,7 @@ TEST_F(AvrcpConnectionHandlerTest, disconnectTest) { &mock_volume_)); connection_handler_ = ConnectionHandler::Get(); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading
android/pandora/test/a2dp_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ from pandora.security_pb2 import LEVEL2 from threading import Thread from typing import Optional AVRCP_CONNECT_A2DP_DELAYED = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_delayed' AVRCP_CONNECT_A2DP_WITH_DELAY = 'persist.device_config.aconfig_flags.bluetooth.com.android.bluetooth.flags.avrcp_connect_a2dp_with_delay' async def initiate_pairing(device, address) -> Connection: """Connect and pair a remote device.""" Loading Loading @@ -264,7 +264,7 @@ class A2dpTest(base_test.BaseTestClass): # type: ignore[misc] # Enable AVRCP connect A2DP delayed feature for server in self.devices._servers: if isinstance(server, AndroidPandoraServer): server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_DELAYED, 'true']) # type: ignore server.device.adb.shell(['setprop', AVRCP_CONNECT_A2DP_WITH_DELAY, 'true']) # type: ignore break # Connect and pair RD1. Loading
flags/avrcp.aconfig +4 −1 Original line number Diff line number Diff line Loading @@ -2,10 +2,13 @@ package: "com.android.bluetooth.flags" container: "com.android.btservices" flag { name: "avrcp_connect_a2dp_delayed" 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 { Loading
system/btif/src/btif_av.cc +1 −1 Original line number Diff line number Diff line Loading @@ -2854,7 +2854,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_delayed() && is_new_avrcp_enabled()) { if (com::android::bluetooth::flags::avrcp_connect_a2dp_with_delay() && is_new_avrcp_enabled()) { // check if device is connected if (bluetooth::avrcp::AvrcpService::Get() != nullptr) { device_connected = Loading
system/profile/avrcp/connection_handler.cc +1 −1 Original line number Diff line number Diff line Loading @@ -404,7 +404,7 @@ 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_delayed()) { 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); } Loading
system/profile/avrcp/tests/avrcp_connection_handler_test.cc +4 −4 Original line number Diff line number Diff line Loading @@ -205,7 +205,7 @@ TEST_F(AvrcpConnectionHandlerTest, remoteDeviceConnectionTest) { // device connects. EXPECT_CALL(mock_avrcp_, OpenBrowse(1, AVCT_ACP)).Times(1); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -245,7 +245,7 @@ TEST_F(AvrcpConnectionHandlerTest, noAbsoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, false); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -289,7 +289,7 @@ TEST_F(AvrcpConnectionHandlerTest, absoluteVolumeTest) { tAVRC_FIND_CBACK sdp_cb; SetUpSdp(&sdp_cb, false, true); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading Loading @@ -321,7 +321,7 @@ TEST_F(AvrcpConnectionHandlerTest, disconnectTest) { &mock_volume_)); connection_handler_ = ConnectionHandler::Get(); if (com::android::bluetooth::flags::avrcp_connect_a2dp_delayed()) { 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); } Loading