Merge "Explicitly mention a confusing proto3 infelicity." into main am: 3a0c095253
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3531073
Change-Id: I4a7e26650f5708129a8d846fe9e9618c61a0d9e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/debuggerd/proto/tombstone.proto b/debuggerd/proto/tombstone.proto
index 444c973..9deeeec 100644
--- a/debuggerd/proto/tombstone.proto
+++ b/debuggerd/proto/tombstone.proto
@@ -15,6 +15,15 @@
// NOTE TO OEMS:
// If you add custom fields to this proto, do not use numbers in the reserved range.
+// NOTE TO CONSUMERS:
+// With proto3 -- unlike proto2 -- HasValue is unreliable for any field
+// where the default value for that type is also a valid value for the field.
+// This means, for example, that a boolean that is false or an integer that
+// is zero will appear to be missing --- but because they're not actually
+// marked as `optional` in this schema, consumers should just use values
+// without first checking whether or not they're "present".
+// https://protobuf.dev/programming-guides/proto3/#default
+
message CrashDetail {
bytes name = 1;
bytes data = 2;