Update MapAction in advertisemet_decoder_rust_impl.cc to take any ActionBit.

PiperOrigin-RevId: 834418752
This commit is contained in:
Anthony Rueda
2025-11-19 13:22:40 -08:00
committed by Copybara-Service
parent 68845e2e3a
commit 0eb6b57423
3 changed files with 7 additions and 16 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "g
git_repository(
name = "beto-core",
commit = "415bd032561d078720642d52e28fd3bc9d5155d4",
commit = "479289ef072b0880c0347d36937265e44f00f4ee",
remote = "https://beto-core.googlesource.com/beto-core",
)
+2 -2
View File
@@ -16,8 +16,8 @@
COMPILED_PROTO_PATH="compiled_proto"
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} connections/implementation/proto/offline_wire_formats.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} internal/proto/analytics/connections_log.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} internal/proto/analytics/fast_pair_log.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} sharing/proto/analytics/nearby_sharing_log.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} proto/connections_enums.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} proto/fast_pair_enums.proto
${PROTOC} --cpp_out=${COMPILED_PROTO_PATH} proto/sharing_enums.proto
@@ -37,19 +37,10 @@ namespace nearby {
namespace presence {
namespace {
absl::StatusOr<nearby_protocol::ActionType> MapAction(const ActionBit action) {
switch (action) {
case ActionBit::kActiveUnlockAction:
return nearby_protocol::ActionType::ActiveUnlock;
case ActionBit::kNearbyShareAction:
return nearby_protocol::ActionType::NearbyShare;
case ActionBit::kInstantTetheringAction:
return nearby_protocol::ActionType::InstantTethering;
case ActionBit::kPhoneHubAction:
return nearby_protocol::ActionType::PhoneHub;
default:
return absl::InvalidArgumentError("Unsupported action type");
}
absl::StatusOr<::nearby_protocol::ActionType> MapAction(
const ActionBit action) {
return ::nearby_protocol::ActionType::TryBuildFromU8(
static_cast<uint8_t>(action));
}
void AddActionsToAdvertisement(const nearby_protocol::V0Actions& parsed_actions,