mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Update MapAction in advertisemet_decoder_rust_impl.cc to take any ActionBit.
PiperOrigin-RevId: 834418752
This commit is contained in:
committed by
Copybara-Service
parent
68845e2e3a
commit
0eb6b57423
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user