From fb982295fbb6a1a4859b9faadb538e7989c560cc Mon Sep 17 00:00:00 2001 From: Anay Wadhera Date: Fri, 7 Jun 2024 12:11:39 -0700 Subject: [PATCH] Move to google.protobuf.FieldMask PiperOrigin-RevId: 641320767 --- sharing/local_device_data/BUILD | 1 + ...by_share_local_device_data_manager_impl.cc | 2 +- sharing/proto/BUILD | 4 +++- sharing/proto/device_rpc.proto | 4 ++-- sharing/proto/field_mask.proto | 24 ------------------- 5 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 sharing/proto/field_mask.proto diff --git a/sharing/local_device_data/BUILD b/sharing/local_device_data/BUILD index 8336d0cf..c3780926 100644 --- a/sharing/local_device_data/BUILD +++ b/sharing/local_device_data/BUILD @@ -42,6 +42,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", + "@com_google_protobuf//:protobuf", ], ) diff --git a/sharing/local_device_data/nearby_share_local_device_data_manager_impl.cc b/sharing/local_device_data/nearby_share_local_device_data_manager_impl.cc index 01dc86a0..c99b950a 100644 --- a/sharing/local_device_data/nearby_share_local_device_data_manager_impl.cc +++ b/sharing/local_device_data/nearby_share_local_device_data_manager_impl.cc @@ -24,6 +24,7 @@ #include #include +#include "google/protobuf/field_mask.pb.h" #include "absl/memory/memory.h" #include "absl/random/random.h" #include "absl/status/statusor.h" @@ -43,7 +44,6 @@ #include "sharing/internal/public/logging.h" #include "sharing/local_device_data/nearby_share_local_device_data_manager.h" #include "sharing/proto/device_rpc.pb.h" -#include "sharing/proto/field_mask.pb.h" #include "sharing/proto/rpc_resources.pb.h" #include "sharing/scheduling/nearby_share_scheduler.h" #include "sharing/scheduling/nearby_share_scheduler_factory.h" diff --git a/sharing/proto/BUILD b/sharing/proto/BUILD index 30f5465d..89a4d2a9 100644 --- a/sharing/proto/BUILD +++ b/sharing/proto/BUILD @@ -24,12 +24,14 @@ proto_library( "contact_rpc.proto", "device_rpc.proto", "encrypted_metadata.proto", - "field_mask.proto", "rpc_resources.proto", "settings_observer_data.proto", "timestamp.proto", ], visibility = ["//visibility:public"], + deps = [ + "@com_google_protobuf//:field_mask_proto", + ], ) cc_proto_library( diff --git a/sharing/proto/device_rpc.proto b/sharing/proto/device_rpc.proto index c92198a4..6bc7e046 100644 --- a/sharing/proto/device_rpc.proto +++ b/sharing/proto/device_rpc.proto @@ -16,7 +16,7 @@ syntax = "proto3"; package nearby.sharing.proto; -import "sharing/proto/field_mask.proto"; +import "google/protobuf/field_mask.proto"; import "sharing/proto/rpc_resources.proto"; option optimize_for = LITE_RUNTIME; @@ -30,7 +30,7 @@ message UpdateDeviceRequest { // The FieldMask for updating specific columns in device table. For the // 'FieldMask' definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 2; } // The response for UpdateDeviceRequest. diff --git a/sharing/proto/field_mask.proto b/sharing/proto/field_mask.proto deleted file mode 100644 index 375ebd77..00000000 --- a/sharing/proto/field_mask.proto +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package nearby.sharing.proto; - -option optimize_for = LITE_RUNTIME; - -message FieldMask { - // The set of field mask paths. - repeated string paths = 1; -}