internal medium fix

PiperOrigin-RevId: 666509363
This commit is contained in:
Guogang Li
2024-08-22 15:22:04 -07:00
committed by Copybara-Service
parent 2c700115ef
commit ec0de73e8e
3 changed files with 15 additions and 2 deletions
+1
View File
@@ -239,6 +239,7 @@ cc_test(
":internal_test",
"//connections:core_types",
"//connections/v3:v3_types",
"//internal/platform:base",
"//internal/platform:test_util",
"//internal/platform:types",
"//internal/platform/implementation/g3", # build_cleaner: keep
@@ -2183,8 +2183,15 @@ void BasePcpHandler::EvaluateConnectionResult(ClientProxy* client,
auto pair = pending_connections_.extract(it);
BasePcpHandler::PendingConnectionInfo& connection_info = pair.mapped();
Medium medium =
channel_manager_->GetChannelForEndpoint(endpoint_id)->GetMedium();
std::shared_ptr<EndpointChannel> endpint_channel =
channel_manager_->GetChannelForEndpoint(endpoint_id);
if (endpint_channel == nullptr) {
NEARBY_LOGS(WARNING) << "No endpint channel for endpoint_id="
<< endpoint_id;
return;
}
Medium medium = endpint_channel->GetMedium();
Status response_code;
if (is_connection_accepted) {
@@ -26,7 +26,11 @@
#include "connections/implementation/mock_device.h"
#include "connections/implementation/simulation_user.h"
#include "connections/medium_selector.h"
#include "connections/out_of_band_connection_metadata.h"
#include "connections/status.h"
#include "connections/strategy.h"
#include "connections/v3/connection_listening_options.h"
#include "internal/platform/byte_array.h"
#include "internal/platform/count_down_latch.h"
#include "internal/platform/medium_environment.h"
@@ -243,6 +247,7 @@ TEST_F(PcpManagerTest, InjectEndpoint) {
.remote_bluetooth_mac_address =
ByteArray(kFakeMacAddress),
});
user_a.StopDiscovery();
user_a.Stop();
env_.Stop();
}