1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: frameworks/base/cmds/incidentd/src/report_file.proto
3
4 #include "frameworks/base/cmds/incidentd/src/report_file.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace android {
22 namespace os {
23 namespace incidentd {
ReportFileProto_Report(::_pbi::ConstantInitialized)24 PROTOBUF_CONSTEXPR ReportFileProto_Report::ReportFileProto_Report(
25 ::_pbi::ConstantInitialized): _impl_{
26 /*decltype(_impl_._has_bits_)*/{}
27 , /*decltype(_impl_._cached_size_)*/{}
28 , /*decltype(_impl_.section_)*/{}
29 , /*decltype(_impl_.header_)*/{}
30 , /*decltype(_impl_.pkg_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
31 , /*decltype(_impl_.cls_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
32 , /*decltype(_impl_.privacy_policy_)*/0u
33 , /*decltype(_impl_.all_sections_)*/false
34 , /*decltype(_impl_.share_approved_)*/false
35 , /*decltype(_impl_.gzip_)*/false} {}
36 struct ReportFileProto_ReportDefaultTypeInternal {
ReportFileProto_ReportDefaultTypeInternalandroid::os::incidentd::ReportFileProto_ReportDefaultTypeInternal37 PROTOBUF_CONSTEXPR ReportFileProto_ReportDefaultTypeInternal()
38 : _instance(::_pbi::ConstantInitialized{}) {}
~ReportFileProto_ReportDefaultTypeInternalandroid::os::incidentd::ReportFileProto_ReportDefaultTypeInternal39 ~ReportFileProto_ReportDefaultTypeInternal() {}
40 union { // NOLINT(misc-non-private-member-variables-in-classes)
41 ReportFileProto_Report _instance;
42 };
43 };
44 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReportFileProto_ReportDefaultTypeInternal _ReportFileProto_Report_default_instance_;
ReportFileProto(::_pbi::ConstantInitialized)45 PROTOBUF_CONSTEXPR ReportFileProto::ReportFileProto(
46 ::_pbi::ConstantInitialized): _impl_{
47 /*decltype(_impl_._has_bits_)*/{}
48 , /*decltype(_impl_._cached_size_)*/{}
49 , /*decltype(_impl_.report_)*/{}
50 , /*decltype(_impl_.data_file_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
51 , /*decltype(_impl_.metadata_)*/nullptr
52 , /*decltype(_impl_.data_file_size_)*/::int64_t{0}
53 , /*decltype(_impl_.privacy_policy_)*/0u
54 , /*decltype(_impl_.completed_)*/false} {}
55 struct ReportFileProtoDefaultTypeInternal {
ReportFileProtoDefaultTypeInternalandroid::os::incidentd::ReportFileProtoDefaultTypeInternal56 PROTOBUF_CONSTEXPR ReportFileProtoDefaultTypeInternal()
57 : _instance(::_pbi::ConstantInitialized{}) {}
~ReportFileProtoDefaultTypeInternalandroid::os::incidentd::ReportFileProtoDefaultTypeInternal58 ~ReportFileProtoDefaultTypeInternal() {}
59 union { // NOLINT(misc-non-private-member-variables-in-classes)
60 ReportFileProto _instance;
61 };
62 };
63 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReportFileProtoDefaultTypeInternal _ReportFileProto_default_instance_;
64 } // namespace incidentd
65 } // namespace os
66 } // namespace android
67 namespace android {
68 namespace os {
69 namespace incidentd {
70
71 // ===================================================================
72
73 class ReportFileProto_Report::_Internal {
74 public:
75 using HasBits = decltype(std::declval<ReportFileProto_Report>()._impl_._has_bits_);
set_has_pkg(HasBits * has_bits)76 static void set_has_pkg(HasBits* has_bits) {
77 (*has_bits)[0] |= 1u;
78 }
set_has_cls(HasBits * has_bits)79 static void set_has_cls(HasBits* has_bits) {
80 (*has_bits)[0] |= 2u;
81 }
set_has_privacy_policy(HasBits * has_bits)82 static void set_has_privacy_policy(HasBits* has_bits) {
83 (*has_bits)[0] |= 4u;
84 }
set_has_all_sections(HasBits * has_bits)85 static void set_has_all_sections(HasBits* has_bits) {
86 (*has_bits)[0] |= 8u;
87 }
set_has_share_approved(HasBits * has_bits)88 static void set_has_share_approved(HasBits* has_bits) {
89 (*has_bits)[0] |= 16u;
90 }
set_has_gzip(HasBits * has_bits)91 static void set_has_gzip(HasBits* has_bits) {
92 (*has_bits)[0] |= 32u;
93 }
94 };
95
ReportFileProto_Report(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)96 ReportFileProto_Report::ReportFileProto_Report(::PROTOBUF_NAMESPACE_ID::Arena* arena,
97 bool is_message_owned)
98 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
99 SharedCtor(arena, is_message_owned);
100 // @@protoc_insertion_point(arena_constructor:android.os.incidentd.ReportFileProto.Report)
101 }
ReportFileProto_Report(const ReportFileProto_Report & from)102 ReportFileProto_Report::ReportFileProto_Report(const ReportFileProto_Report& from)
103 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
104 ReportFileProto_Report* const _this = this; (void)_this;
105 new (&_impl_) Impl_{
106 decltype(_impl_._has_bits_){from._impl_._has_bits_}
107 , /*decltype(_impl_._cached_size_)*/{}
108 , decltype(_impl_.section_){from._impl_.section_}
109 , decltype(_impl_.header_){from._impl_.header_}
110 , decltype(_impl_.pkg_){}
111 , decltype(_impl_.cls_){}
112 , decltype(_impl_.privacy_policy_){}
113 , decltype(_impl_.all_sections_){}
114 , decltype(_impl_.share_approved_){}
115 , decltype(_impl_.gzip_){}};
116
117 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
118 _impl_.pkg_.InitDefault();
119 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
120 _impl_.pkg_.Set("", GetArenaForAllocation());
121 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
122 if (from._internal_has_pkg()) {
123 _this->_impl_.pkg_.Set(from._internal_pkg(),
124 _this->GetArenaForAllocation());
125 }
126 _impl_.cls_.InitDefault();
127 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
128 _impl_.cls_.Set("", GetArenaForAllocation());
129 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
130 if (from._internal_has_cls()) {
131 _this->_impl_.cls_.Set(from._internal_cls(),
132 _this->GetArenaForAllocation());
133 }
134 ::memcpy(&_impl_.privacy_policy_, &from._impl_.privacy_policy_,
135 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.gzip_) -
136 reinterpret_cast<char*>(&_impl_.privacy_policy_)) + sizeof(_impl_.gzip_));
137 // @@protoc_insertion_point(copy_constructor:android.os.incidentd.ReportFileProto.Report)
138 }
139
SharedCtor(::_pb::Arena * arena,bool is_message_owned)140 inline void ReportFileProto_Report::SharedCtor(
141 ::_pb::Arena* arena, bool is_message_owned) {
142 (void)arena;
143 (void)is_message_owned;
144 new (&_impl_) Impl_{
145 decltype(_impl_._has_bits_){}
146 , /*decltype(_impl_._cached_size_)*/{}
147 , decltype(_impl_.section_){arena}
148 , decltype(_impl_.header_){arena}
149 , decltype(_impl_.pkg_){}
150 , decltype(_impl_.cls_){}
151 , decltype(_impl_.privacy_policy_){0u}
152 , decltype(_impl_.all_sections_){false}
153 , decltype(_impl_.share_approved_){false}
154 , decltype(_impl_.gzip_){false}
155 };
156 _impl_.pkg_.InitDefault();
157 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
158 _impl_.pkg_.Set("", GetArenaForAllocation());
159 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
160 _impl_.cls_.InitDefault();
161 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
162 _impl_.cls_.Set("", GetArenaForAllocation());
163 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
164 }
165
~ReportFileProto_Report()166 ReportFileProto_Report::~ReportFileProto_Report() {
167 // @@protoc_insertion_point(destructor:android.os.incidentd.ReportFileProto.Report)
168 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
169 (void)arena;
170 return;
171 }
172 SharedDtor();
173 }
174
SharedDtor()175 inline void ReportFileProto_Report::SharedDtor() {
176 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
177 _impl_.section_.~RepeatedField();
178 _impl_.header_.~RepeatedPtrField();
179 _impl_.pkg_.Destroy();
180 _impl_.cls_.Destroy();
181 }
182
SetCachedSize(int size) const183 void ReportFileProto_Report::SetCachedSize(int size) const {
184 _impl_._cached_size_.Set(size);
185 }
186
Clear()187 void ReportFileProto_Report::Clear() {
188 // @@protoc_insertion_point(message_clear_start:android.os.incidentd.ReportFileProto.Report)
189 ::uint32_t cached_has_bits = 0;
190 // Prevent compiler warnings about cached_has_bits being unused
191 (void) cached_has_bits;
192
193 _impl_.section_.Clear();
194 _impl_.header_.Clear();
195 cached_has_bits = _impl_._has_bits_[0];
196 if (cached_has_bits & 0x00000003u) {
197 if (cached_has_bits & 0x00000001u) {
198 _impl_.pkg_.ClearNonDefaultToEmpty();
199 }
200 if (cached_has_bits & 0x00000002u) {
201 _impl_.cls_.ClearNonDefaultToEmpty();
202 }
203 }
204 if (cached_has_bits & 0x0000003cu) {
205 ::memset(&_impl_.privacy_policy_, 0, static_cast<size_t>(
206 reinterpret_cast<char*>(&_impl_.gzip_) -
207 reinterpret_cast<char*>(&_impl_.privacy_policy_)) + sizeof(_impl_.gzip_));
208 }
209 _impl_._has_bits_.Clear();
210 _internal_metadata_.Clear<std::string>();
211 }
212
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)213 const char* ReportFileProto_Report::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
214 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
215 _Internal::HasBits has_bits{};
216 while (!ctx->Done(&ptr)) {
217 ::uint32_t tag;
218 ptr = ::_pbi::ReadTag(ptr, &tag);
219 switch (tag >> 3) {
220 // optional string pkg = 1;
221 case 1:
222 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
223 auto str = _internal_mutable_pkg();
224 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
225 CHK_(ptr);
226 } else {
227 goto handle_unusual;
228 }
229 continue;
230 // optional string cls = 2;
231 case 2:
232 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
233 auto str = _internal_mutable_cls();
234 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
235 CHK_(ptr);
236 } else {
237 goto handle_unusual;
238 }
239 continue;
240 // optional uint32 privacy_policy = 4;
241 case 4:
242 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
243 _Internal::set_has_privacy_policy(&has_bits);
244 _impl_.privacy_policy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
245 CHK_(ptr);
246 } else {
247 goto handle_unusual;
248 }
249 continue;
250 // optional bool all_sections = 5;
251 case 5:
252 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
253 _Internal::set_has_all_sections(&has_bits);
254 _impl_.all_sections_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
255 CHK_(ptr);
256 } else {
257 goto handle_unusual;
258 }
259 continue;
260 // repeated int32 section = 6;
261 case 6:
262 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
263 ptr -= 1;
264 do {
265 ptr += 1;
266 _internal_add_section(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
267 CHK_(ptr);
268 if (!ctx->DataAvailable(ptr)) break;
269 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<48>(ptr));
270 } else if (static_cast<::uint8_t>(tag) == 50) {
271 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_section(), ptr, ctx);
272 CHK_(ptr);
273 } else {
274 goto handle_unusual;
275 }
276 continue;
277 // repeated bytes header = 7;
278 case 7:
279 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
280 ptr -= 1;
281 do {
282 ptr += 1;
283 auto str = _internal_add_header();
284 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
285 CHK_(ptr);
286 if (!ctx->DataAvailable(ptr)) break;
287 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
288 } else {
289 goto handle_unusual;
290 }
291 continue;
292 // optional bool share_approved = 8;
293 case 8:
294 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
295 _Internal::set_has_share_approved(&has_bits);
296 _impl_.share_approved_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
297 CHK_(ptr);
298 } else {
299 goto handle_unusual;
300 }
301 continue;
302 // optional bool gzip = 9;
303 case 9:
304 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
305 _Internal::set_has_gzip(&has_bits);
306 _impl_.gzip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
307 CHK_(ptr);
308 } else {
309 goto handle_unusual;
310 }
311 continue;
312 default:
313 goto handle_unusual;
314 } // switch
315 handle_unusual:
316 if ((tag == 0) || ((tag & 7) == 4)) {
317 CHK_(ptr);
318 ctx->SetLastTag(tag);
319 goto message_done;
320 }
321 ptr = UnknownFieldParse(
322 tag,
323 _internal_metadata_.mutable_unknown_fields<std::string>(),
324 ptr, ctx);
325 CHK_(ptr != nullptr);
326 } // while
327 message_done:
328 _impl_._has_bits_.Or(has_bits);
329 return ptr;
330 failure:
331 ptr = nullptr;
332 goto message_done;
333 #undef CHK_
334 }
335
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const336 ::uint8_t* ReportFileProto_Report::_InternalSerialize(
337 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
338 // @@protoc_insertion_point(serialize_to_array_start:android.os.incidentd.ReportFileProto.Report)
339 ::uint32_t cached_has_bits = 0;
340 (void) cached_has_bits;
341
342 cached_has_bits = _impl_._has_bits_[0];
343 // optional string pkg = 1;
344 if (cached_has_bits & 0x00000001u) {
345 target = stream->WriteStringMaybeAliased(
346 1, this->_internal_pkg(), target);
347 }
348
349 // optional string cls = 2;
350 if (cached_has_bits & 0x00000002u) {
351 target = stream->WriteStringMaybeAliased(
352 2, this->_internal_cls(), target);
353 }
354
355 // optional uint32 privacy_policy = 4;
356 if (cached_has_bits & 0x00000004u) {
357 target = stream->EnsureSpace(target);
358 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_privacy_policy(), target);
359 }
360
361 // optional bool all_sections = 5;
362 if (cached_has_bits & 0x00000008u) {
363 target = stream->EnsureSpace(target);
364 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_all_sections(), target);
365 }
366
367 // repeated int32 section = 6;
368 for (int i = 0, n = this->_internal_section_size(); i < n; i++) {
369 target = stream->EnsureSpace(target);
370 target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_section(i), target);
371 }
372
373 // repeated bytes header = 7;
374 for (int i = 0, n = this->_internal_header_size(); i < n; i++) {
375 const auto& s = this->_internal_header(i);
376 target = stream->WriteBytes(7, s, target);
377 }
378
379 // optional bool share_approved = 8;
380 if (cached_has_bits & 0x00000010u) {
381 target = stream->EnsureSpace(target);
382 target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_share_approved(), target);
383 }
384
385 // optional bool gzip = 9;
386 if (cached_has_bits & 0x00000020u) {
387 target = stream->EnsureSpace(target);
388 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_gzip(), target);
389 }
390
391 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
392 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
393 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
394 }
395 // @@protoc_insertion_point(serialize_to_array_end:android.os.incidentd.ReportFileProto.Report)
396 return target;
397 }
398
ByteSizeLong() const399 size_t ReportFileProto_Report::ByteSizeLong() const {
400 // @@protoc_insertion_point(message_byte_size_start:android.os.incidentd.ReportFileProto.Report)
401 size_t total_size = 0;
402
403 ::uint32_t cached_has_bits = 0;
404 // Prevent compiler warnings about cached_has_bits being unused
405 (void) cached_has_bits;
406
407 // repeated int32 section = 6;
408 {
409 size_t data_size = ::_pbi::WireFormatLite::
410 Int32Size(this->_impl_.section_);
411 total_size += 1 *
412 ::_pbi::FromIntSize(this->_internal_section_size());
413 total_size += data_size;
414 }
415
416 // repeated bytes header = 7;
417 total_size += 1 *
418 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.header_.size());
419 for (int i = 0, n = _impl_.header_.size(); i < n; i++) {
420 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
421 _impl_.header_.Get(i));
422 }
423
424 cached_has_bits = _impl_._has_bits_[0];
425 if (cached_has_bits & 0x0000003fu) {
426 // optional string pkg = 1;
427 if (cached_has_bits & 0x00000001u) {
428 total_size += 1 +
429 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
430 this->_internal_pkg());
431 }
432
433 // optional string cls = 2;
434 if (cached_has_bits & 0x00000002u) {
435 total_size += 1 +
436 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
437 this->_internal_cls());
438 }
439
440 // optional uint32 privacy_policy = 4;
441 if (cached_has_bits & 0x00000004u) {
442 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_privacy_policy());
443 }
444
445 // optional bool all_sections = 5;
446 if (cached_has_bits & 0x00000008u) {
447 total_size += 1 + 1;
448 }
449
450 // optional bool share_approved = 8;
451 if (cached_has_bits & 0x00000010u) {
452 total_size += 1 + 1;
453 }
454
455 // optional bool gzip = 9;
456 if (cached_has_bits & 0x00000020u) {
457 total_size += 1 + 1;
458 }
459
460 }
461 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
462 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
463 }
464 int cached_size = ::_pbi::ToCachedSize(total_size);
465 SetCachedSize(cached_size);
466 return total_size;
467 }
468
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)469 void ReportFileProto_Report::CheckTypeAndMergeFrom(
470 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
471 MergeFrom(*::_pbi::DownCast<const ReportFileProto_Report*>(
472 &from));
473 }
474
MergeFrom(const ReportFileProto_Report & from)475 void ReportFileProto_Report::MergeFrom(const ReportFileProto_Report& from) {
476 ReportFileProto_Report* const _this = this;
477 // @@protoc_insertion_point(class_specific_merge_from_start:android.os.incidentd.ReportFileProto.Report)
478 GOOGLE_DCHECK_NE(&from, _this);
479 ::uint32_t cached_has_bits = 0;
480 (void) cached_has_bits;
481
482 _this->_impl_.section_.MergeFrom(from._impl_.section_);
483 _this->_impl_.header_.MergeFrom(from._impl_.header_);
484 cached_has_bits = from._impl_._has_bits_[0];
485 if (cached_has_bits & 0x0000003fu) {
486 if (cached_has_bits & 0x00000001u) {
487 _this->_internal_set_pkg(from._internal_pkg());
488 }
489 if (cached_has_bits & 0x00000002u) {
490 _this->_internal_set_cls(from._internal_cls());
491 }
492 if (cached_has_bits & 0x00000004u) {
493 _this->_impl_.privacy_policy_ = from._impl_.privacy_policy_;
494 }
495 if (cached_has_bits & 0x00000008u) {
496 _this->_impl_.all_sections_ = from._impl_.all_sections_;
497 }
498 if (cached_has_bits & 0x00000010u) {
499 _this->_impl_.share_approved_ = from._impl_.share_approved_;
500 }
501 if (cached_has_bits & 0x00000020u) {
502 _this->_impl_.gzip_ = from._impl_.gzip_;
503 }
504 _this->_impl_._has_bits_[0] |= cached_has_bits;
505 }
506 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
507 }
508
CopyFrom(const ReportFileProto_Report & from)509 void ReportFileProto_Report::CopyFrom(const ReportFileProto_Report& from) {
510 // @@protoc_insertion_point(class_specific_copy_from_start:android.os.incidentd.ReportFileProto.Report)
511 if (&from == this) return;
512 Clear();
513 MergeFrom(from);
514 }
515
IsInitialized() const516 bool ReportFileProto_Report::IsInitialized() const {
517 return true;
518 }
519
InternalSwap(ReportFileProto_Report * other)520 void ReportFileProto_Report::InternalSwap(ReportFileProto_Report* other) {
521 using std::swap;
522 auto* lhs_arena = GetArenaForAllocation();
523 auto* rhs_arena = other->GetArenaForAllocation();
524 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
525 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
526 _impl_.section_.InternalSwap(&other->_impl_.section_);
527 _impl_.header_.InternalSwap(&other->_impl_.header_);
528 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
529 &_impl_.pkg_, lhs_arena,
530 &other->_impl_.pkg_, rhs_arena
531 );
532 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
533 &_impl_.cls_, lhs_arena,
534 &other->_impl_.cls_, rhs_arena
535 );
536 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
537 PROTOBUF_FIELD_OFFSET(ReportFileProto_Report, _impl_.gzip_)
538 + sizeof(ReportFileProto_Report::_impl_.gzip_) // NOLINT
539 - PROTOBUF_FIELD_OFFSET(ReportFileProto_Report, _impl_.privacy_policy_)>(
540 reinterpret_cast<char*>(&_impl_.privacy_policy_),
541 reinterpret_cast<char*>(&other->_impl_.privacy_policy_));
542 }
543
GetTypeName() const544 std::string ReportFileProto_Report::GetTypeName() const {
545 return "android.os.incidentd.ReportFileProto.Report";
546 }
547
548
549 // ===================================================================
550
551 class ReportFileProto::_Internal {
552 public:
553 using HasBits = decltype(std::declval<ReportFileProto>()._impl_._has_bits_);
554 static const ::android::os::IncidentMetadata& metadata(const ReportFileProto* msg);
set_has_metadata(HasBits * has_bits)555 static void set_has_metadata(HasBits* has_bits) {
556 (*has_bits)[0] |= 2u;
557 }
set_has_data_file(HasBits * has_bits)558 static void set_has_data_file(HasBits* has_bits) {
559 (*has_bits)[0] |= 1u;
560 }
set_has_privacy_policy(HasBits * has_bits)561 static void set_has_privacy_policy(HasBits* has_bits) {
562 (*has_bits)[0] |= 8u;
563 }
set_has_data_file_size(HasBits * has_bits)564 static void set_has_data_file_size(HasBits* has_bits) {
565 (*has_bits)[0] |= 4u;
566 }
set_has_completed(HasBits * has_bits)567 static void set_has_completed(HasBits* has_bits) {
568 (*has_bits)[0] |= 16u;
569 }
570 };
571
572 const ::android::os::IncidentMetadata&
metadata(const ReportFileProto * msg)573 ReportFileProto::_Internal::metadata(const ReportFileProto* msg) {
574 return *msg->_impl_.metadata_;
575 }
clear_metadata()576 void ReportFileProto::clear_metadata() {
577 if (_impl_.metadata_ != nullptr) _impl_.metadata_->Clear();
578 _impl_._has_bits_[0] &= ~0x00000002u;
579 }
ReportFileProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)580 ReportFileProto::ReportFileProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
581 bool is_message_owned)
582 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
583 SharedCtor(arena, is_message_owned);
584 // @@protoc_insertion_point(arena_constructor:android.os.incidentd.ReportFileProto)
585 }
ReportFileProto(const ReportFileProto & from)586 ReportFileProto::ReportFileProto(const ReportFileProto& from)
587 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
588 ReportFileProto* const _this = this; (void)_this;
589 new (&_impl_) Impl_{
590 decltype(_impl_._has_bits_){from._impl_._has_bits_}
591 , /*decltype(_impl_._cached_size_)*/{}
592 , decltype(_impl_.report_){from._impl_.report_}
593 , decltype(_impl_.data_file_){}
594 , decltype(_impl_.metadata_){nullptr}
595 , decltype(_impl_.data_file_size_){}
596 , decltype(_impl_.privacy_policy_){}
597 , decltype(_impl_.completed_){}};
598
599 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
600 _impl_.data_file_.InitDefault();
601 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
602 _impl_.data_file_.Set("", GetArenaForAllocation());
603 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
604 if (from._internal_has_data_file()) {
605 _this->_impl_.data_file_.Set(from._internal_data_file(),
606 _this->GetArenaForAllocation());
607 }
608 if (from._internal_has_metadata()) {
609 _this->_impl_.metadata_ = new ::android::os::IncidentMetadata(*from._impl_.metadata_);
610 }
611 ::memcpy(&_impl_.data_file_size_, &from._impl_.data_file_size_,
612 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.completed_) -
613 reinterpret_cast<char*>(&_impl_.data_file_size_)) + sizeof(_impl_.completed_));
614 // @@protoc_insertion_point(copy_constructor:android.os.incidentd.ReportFileProto)
615 }
616
SharedCtor(::_pb::Arena * arena,bool is_message_owned)617 inline void ReportFileProto::SharedCtor(
618 ::_pb::Arena* arena, bool is_message_owned) {
619 (void)arena;
620 (void)is_message_owned;
621 new (&_impl_) Impl_{
622 decltype(_impl_._has_bits_){}
623 , /*decltype(_impl_._cached_size_)*/{}
624 , decltype(_impl_.report_){arena}
625 , decltype(_impl_.data_file_){}
626 , decltype(_impl_.metadata_){nullptr}
627 , decltype(_impl_.data_file_size_){::int64_t{0}}
628 , decltype(_impl_.privacy_policy_){0u}
629 , decltype(_impl_.completed_){false}
630 };
631 _impl_.data_file_.InitDefault();
632 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
633 _impl_.data_file_.Set("", GetArenaForAllocation());
634 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
635 }
636
~ReportFileProto()637 ReportFileProto::~ReportFileProto() {
638 // @@protoc_insertion_point(destructor:android.os.incidentd.ReportFileProto)
639 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
640 (void)arena;
641 return;
642 }
643 SharedDtor();
644 }
645
SharedDtor()646 inline void ReportFileProto::SharedDtor() {
647 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
648 _impl_.report_.~RepeatedPtrField();
649 _impl_.data_file_.Destroy();
650 if (this != internal_default_instance()) delete _impl_.metadata_;
651 }
652
SetCachedSize(int size) const653 void ReportFileProto::SetCachedSize(int size) const {
654 _impl_._cached_size_.Set(size);
655 }
656
Clear()657 void ReportFileProto::Clear() {
658 // @@protoc_insertion_point(message_clear_start:android.os.incidentd.ReportFileProto)
659 ::uint32_t cached_has_bits = 0;
660 // Prevent compiler warnings about cached_has_bits being unused
661 (void) cached_has_bits;
662
663 _impl_.report_.Clear();
664 cached_has_bits = _impl_._has_bits_[0];
665 if (cached_has_bits & 0x00000003u) {
666 if (cached_has_bits & 0x00000001u) {
667 _impl_.data_file_.ClearNonDefaultToEmpty();
668 }
669 if (cached_has_bits & 0x00000002u) {
670 GOOGLE_DCHECK(_impl_.metadata_ != nullptr);
671 _impl_.metadata_->Clear();
672 }
673 }
674 if (cached_has_bits & 0x0000001cu) {
675 ::memset(&_impl_.data_file_size_, 0, static_cast<size_t>(
676 reinterpret_cast<char*>(&_impl_.completed_) -
677 reinterpret_cast<char*>(&_impl_.data_file_size_)) + sizeof(_impl_.completed_));
678 }
679 _impl_._has_bits_.Clear();
680 _internal_metadata_.Clear<std::string>();
681 }
682
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)683 const char* ReportFileProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
684 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
685 _Internal::HasBits has_bits{};
686 while (!ctx->Done(&ptr)) {
687 ::uint32_t tag;
688 ptr = ::_pbi::ReadTag(ptr, &tag);
689 switch (tag >> 3) {
690 // optional .android.os.IncidentMetadata metadata = 1;
691 case 1:
692 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
693 ptr = ctx->ParseMessage(_internal_mutable_metadata(), ptr);
694 CHK_(ptr);
695 } else {
696 goto handle_unusual;
697 }
698 continue;
699 // repeated .android.os.incidentd.ReportFileProto.Report report = 2;
700 case 2:
701 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
702 ptr -= 1;
703 do {
704 ptr += 1;
705 ptr = ctx->ParseMessage(_internal_add_report(), ptr);
706 CHK_(ptr);
707 if (!ctx->DataAvailable(ptr)) break;
708 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
709 } else {
710 goto handle_unusual;
711 }
712 continue;
713 // optional string data_file = 3;
714 case 3:
715 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
716 auto str = _internal_mutable_data_file();
717 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
718 CHK_(ptr);
719 } else {
720 goto handle_unusual;
721 }
722 continue;
723 // optional uint32 privacy_policy = 4;
724 case 4:
725 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
726 _Internal::set_has_privacy_policy(&has_bits);
727 _impl_.privacy_policy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
728 CHK_(ptr);
729 } else {
730 goto handle_unusual;
731 }
732 continue;
733 // optional int64 data_file_size = 5;
734 case 5:
735 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
736 _Internal::set_has_data_file_size(&has_bits);
737 _impl_.data_file_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
738 CHK_(ptr);
739 } else {
740 goto handle_unusual;
741 }
742 continue;
743 // optional bool completed = 6;
744 case 6:
745 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
746 _Internal::set_has_completed(&has_bits);
747 _impl_.completed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
748 CHK_(ptr);
749 } else {
750 goto handle_unusual;
751 }
752 continue;
753 default:
754 goto handle_unusual;
755 } // switch
756 handle_unusual:
757 if ((tag == 0) || ((tag & 7) == 4)) {
758 CHK_(ptr);
759 ctx->SetLastTag(tag);
760 goto message_done;
761 }
762 ptr = UnknownFieldParse(
763 tag,
764 _internal_metadata_.mutable_unknown_fields<std::string>(),
765 ptr, ctx);
766 CHK_(ptr != nullptr);
767 } // while
768 message_done:
769 _impl_._has_bits_.Or(has_bits);
770 return ptr;
771 failure:
772 ptr = nullptr;
773 goto message_done;
774 #undef CHK_
775 }
776
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const777 ::uint8_t* ReportFileProto::_InternalSerialize(
778 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
779 // @@protoc_insertion_point(serialize_to_array_start:android.os.incidentd.ReportFileProto)
780 ::uint32_t cached_has_bits = 0;
781 (void) cached_has_bits;
782
783 cached_has_bits = _impl_._has_bits_[0];
784 // optional .android.os.IncidentMetadata metadata = 1;
785 if (cached_has_bits & 0x00000002u) {
786 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
787 InternalWriteMessage(1, _Internal::metadata(this),
788 _Internal::metadata(this).GetCachedSize(), target, stream);
789 }
790
791 // repeated .android.os.incidentd.ReportFileProto.Report report = 2;
792 for (unsigned i = 0,
793 n = static_cast<unsigned>(this->_internal_report_size()); i < n; i++) {
794 const auto& repfield = this->_internal_report(i);
795 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
796 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
797 }
798
799 // optional string data_file = 3;
800 if (cached_has_bits & 0x00000001u) {
801 target = stream->WriteStringMaybeAliased(
802 3, this->_internal_data_file(), target);
803 }
804
805 // optional uint32 privacy_policy = 4;
806 if (cached_has_bits & 0x00000008u) {
807 target = stream->EnsureSpace(target);
808 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_privacy_policy(), target);
809 }
810
811 // optional int64 data_file_size = 5;
812 if (cached_has_bits & 0x00000004u) {
813 target = stream->EnsureSpace(target);
814 target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_data_file_size(), target);
815 }
816
817 // optional bool completed = 6;
818 if (cached_has_bits & 0x00000010u) {
819 target = stream->EnsureSpace(target);
820 target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_completed(), target);
821 }
822
823 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
824 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
825 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
826 }
827 // @@protoc_insertion_point(serialize_to_array_end:android.os.incidentd.ReportFileProto)
828 return target;
829 }
830
ByteSizeLong() const831 size_t ReportFileProto::ByteSizeLong() const {
832 // @@protoc_insertion_point(message_byte_size_start:android.os.incidentd.ReportFileProto)
833 size_t total_size = 0;
834
835 ::uint32_t cached_has_bits = 0;
836 // Prevent compiler warnings about cached_has_bits being unused
837 (void) cached_has_bits;
838
839 // repeated .android.os.incidentd.ReportFileProto.Report report = 2;
840 total_size += 1UL * this->_internal_report_size();
841 for (const auto& msg : this->_impl_.report_) {
842 total_size +=
843 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
844 }
845
846 cached_has_bits = _impl_._has_bits_[0];
847 if (cached_has_bits & 0x0000001fu) {
848 // optional string data_file = 3;
849 if (cached_has_bits & 0x00000001u) {
850 total_size += 1 +
851 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
852 this->_internal_data_file());
853 }
854
855 // optional .android.os.IncidentMetadata metadata = 1;
856 if (cached_has_bits & 0x00000002u) {
857 total_size += 1 +
858 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
859 *_impl_.metadata_);
860 }
861
862 // optional int64 data_file_size = 5;
863 if (cached_has_bits & 0x00000004u) {
864 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_data_file_size());
865 }
866
867 // optional uint32 privacy_policy = 4;
868 if (cached_has_bits & 0x00000008u) {
869 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_privacy_policy());
870 }
871
872 // optional bool completed = 6;
873 if (cached_has_bits & 0x00000010u) {
874 total_size += 1 + 1;
875 }
876
877 }
878 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
879 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
880 }
881 int cached_size = ::_pbi::ToCachedSize(total_size);
882 SetCachedSize(cached_size);
883 return total_size;
884 }
885
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)886 void ReportFileProto::CheckTypeAndMergeFrom(
887 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
888 MergeFrom(*::_pbi::DownCast<const ReportFileProto*>(
889 &from));
890 }
891
MergeFrom(const ReportFileProto & from)892 void ReportFileProto::MergeFrom(const ReportFileProto& from) {
893 ReportFileProto* const _this = this;
894 // @@protoc_insertion_point(class_specific_merge_from_start:android.os.incidentd.ReportFileProto)
895 GOOGLE_DCHECK_NE(&from, _this);
896 ::uint32_t cached_has_bits = 0;
897 (void) cached_has_bits;
898
899 _this->_impl_.report_.MergeFrom(from._impl_.report_);
900 cached_has_bits = from._impl_._has_bits_[0];
901 if (cached_has_bits & 0x0000001fu) {
902 if (cached_has_bits & 0x00000001u) {
903 _this->_internal_set_data_file(from._internal_data_file());
904 }
905 if (cached_has_bits & 0x00000002u) {
906 _this->_internal_mutable_metadata()->::android::os::IncidentMetadata::MergeFrom(
907 from._internal_metadata());
908 }
909 if (cached_has_bits & 0x00000004u) {
910 _this->_impl_.data_file_size_ = from._impl_.data_file_size_;
911 }
912 if (cached_has_bits & 0x00000008u) {
913 _this->_impl_.privacy_policy_ = from._impl_.privacy_policy_;
914 }
915 if (cached_has_bits & 0x00000010u) {
916 _this->_impl_.completed_ = from._impl_.completed_;
917 }
918 _this->_impl_._has_bits_[0] |= cached_has_bits;
919 }
920 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
921 }
922
CopyFrom(const ReportFileProto & from)923 void ReportFileProto::CopyFrom(const ReportFileProto& from) {
924 // @@protoc_insertion_point(class_specific_copy_from_start:android.os.incidentd.ReportFileProto)
925 if (&from == this) return;
926 Clear();
927 MergeFrom(from);
928 }
929
IsInitialized() const930 bool ReportFileProto::IsInitialized() const {
931 return true;
932 }
933
InternalSwap(ReportFileProto * other)934 void ReportFileProto::InternalSwap(ReportFileProto* other) {
935 using std::swap;
936 auto* lhs_arena = GetArenaForAllocation();
937 auto* rhs_arena = other->GetArenaForAllocation();
938 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
939 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
940 _impl_.report_.InternalSwap(&other->_impl_.report_);
941 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
942 &_impl_.data_file_, lhs_arena,
943 &other->_impl_.data_file_, rhs_arena
944 );
945 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
946 PROTOBUF_FIELD_OFFSET(ReportFileProto, _impl_.completed_)
947 + sizeof(ReportFileProto::_impl_.completed_) // NOLINT
948 - PROTOBUF_FIELD_OFFSET(ReportFileProto, _impl_.metadata_)>(
949 reinterpret_cast<char*>(&_impl_.metadata_),
950 reinterpret_cast<char*>(&other->_impl_.metadata_));
951 }
952
GetTypeName() const953 std::string ReportFileProto::GetTypeName() const {
954 return "android.os.incidentd.ReportFileProto";
955 }
956
957
958 // @@protoc_insertion_point(namespace_scope)
959 } // namespace incidentd
960 } // namespace os
961 } // namespace android
962 PROTOBUF_NAMESPACE_OPEN
963 template<> PROTOBUF_NOINLINE ::android::os::incidentd::ReportFileProto_Report*
CreateMaybeMessage(Arena * arena)964 Arena::CreateMaybeMessage< ::android::os::incidentd::ReportFileProto_Report >(Arena* arena) {
965 return Arena::CreateMessageInternal< ::android::os::incidentd::ReportFileProto_Report >(arena);
966 }
967 template<> PROTOBUF_NOINLINE ::android::os::incidentd::ReportFileProto*
CreateMaybeMessage(Arena * arena)968 Arena::CreateMaybeMessage< ::android::os::incidentd::ReportFileProto >(Arena* arena) {
969 return Arena::CreateMessageInternal< ::android::os::incidentd::ReportFileProto >(arena);
970 }
971 PROTOBUF_NAMESPACE_CLOSE
972
973 // @@protoc_insertion_point(global_scope)
974 #include <google/protobuf/port_undef.inc>
975