mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
[BLE V2] Mark ChromeOS fast advertisements as non-connectable
PiperOrigin-RevId: 728862084
This commit is contained in:
committed by
Copybara-Service
parent
46c0f153fe
commit
e7f45020bb
@@ -59,6 +59,7 @@ cc_library(
|
||||
"//internal/platform:types",
|
||||
"//internal/platform:uuid",
|
||||
"//internal/platform/implementation:comm",
|
||||
"//internal/platform/implementation:platform",
|
||||
"//internal/platform/implementation:wifi_utils",
|
||||
"//proto/mediums:web_rtc_signaling_frames_cc_proto",
|
||||
# TODO: Support WebRTC
|
||||
|
||||
@@ -47,9 +47,11 @@
|
||||
#include "internal/platform/expected.h"
|
||||
#include "internal/platform/feature_flags.h"
|
||||
#include "internal/platform/implementation/ble_v2.h"
|
||||
#include "internal/platform/implementation/platform.h"
|
||||
#include "internal/platform/logging.h"
|
||||
#include "internal/platform/mutex.h"
|
||||
#include "internal/platform/mutex_lock.h"
|
||||
#include "internal/platform/os_name.h"
|
||||
#include "internal/platform/runnable.h"
|
||||
#include "internal/platform/uuid.h"
|
||||
|
||||
@@ -922,10 +924,17 @@ bool BleV2::StartFastAdvertisingLocked(
|
||||
{mediums::bleutils::kCopresenceServiceUuid, medium_advertisement_bytes});
|
||||
|
||||
// Finally, start the fast advertising operation.
|
||||
bool is_connectable = true;
|
||||
if (api::ImplementationPlatform::GetCurrentOS() == api::OSName::kChromeOS) {
|
||||
// The ChromeOS platform cannot support connectable
|
||||
// fast advertisements (b/395934066).
|
||||
is_connectable = false;
|
||||
}
|
||||
|
||||
if (!medium_.StartAdvertising(
|
||||
advertising_data,
|
||||
{.tx_power_level = PowerLevelToTxPowerLevel(power_level),
|
||||
.is_connectable = true})) {
|
||||
.is_connectable = is_connectable})) {
|
||||
LOG(ERROR) << "Failed to turn on BLE fast advertising with "
|
||||
"advertisement bytes="
|
||||
<< absl::BytesToHexString(medium_advertisement_bytes.data());
|
||||
|
||||
Reference in New Issue
Block a user