Fixed the bug of passing connection request info

PiperOrigin-RevId: 592248269
This commit is contained in:
Guogang Li
2023-12-19 08:46:17 -08:00
committed by Copybara-Service
parent 63e744e133
commit 850c3e2788
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ void StartAdvertising(Core *pCore, const char *service_id,
}
connections::ConnectionRequestInfo crInfo;
crInfo.endpoint_info = ByteArray(info.endpoint_info);
crInfo.endpoint_info = ByteArray(info.endpoint_info, info.endpoint_info_size);
crInfo.listener = std::move(*(info.listener.GetImpl()));
connections::AdvertisingOptions advertising_options;
+3 -1
View File
@@ -14,6 +14,7 @@
#include "connections/dart/core_adapter_dart.h"
#include <cstddef>
#include <cstdint>
#include <string>
@@ -424,7 +425,8 @@ void StartAdvertisingDart(
ConnectionRequestInfoW info{
connection_request_info_dart.endpoint_info,
strlen(connection_request_info_dart.endpoint_info), listener};
static_cast<size_t>(connection_request_info_dart.endpoint_info_size),
listener};
ResultCallbackW callback;
SetResultCallback(callback, result_cb);
+1
View File
@@ -132,6 +132,7 @@ struct ConnectionListenerDart {
struct ConnectionRequestInfoDart {
// LINT.IfChange
int endpoint_info_size;
char *endpoint_info;
ConnectionListenerDart connection_listener;
// LINT.ThenChange(//depot/google3/location/nearby/apps/helloconnections/plugins/nearby_connections/platform/lib/types/connection_request_info.dart)