Fix AtomMetricStats int64 field passed to helper function

Test: atest statsd_test
Bug: 175026771
Change-Id: Ie0a256ca64a06bbdc98b6fc0c6cdadba302d6f17
diff --git a/bin/src/stats_log_util.cpp b/bin/src/stats_log_util.cpp
index d6e04f7..a7e4d70 100644
--- a/bin/src/stats_log_util.cpp
+++ b/bin/src/stats_log_util.cpp
@@ -465,7 +465,7 @@
     }
 }
 
-void writeNonZeroStatToStream(const uint64_t fieldId, const int value,
+void writeNonZeroStatToStream(const uint64_t fieldId, const int64_t value,
                               util::ProtoOutputStream* protoOutput) {
     if (value != 0) {
         protoOutput->write(fieldId, value);
diff --git a/bin/src/stats_log_util.h b/bin/src/stats_log_util.h
index dcfe0c7..1ba4c4a 100644
--- a/bin/src/stats_log_util.h
+++ b/bin/src/stats_log_util.h
@@ -78,7 +78,7 @@
 int64_t MillisToNano(const int64_t millis);
 
 // Helper function to write a stats field to ProtoOutputStream if it's a non-zero value.
-void writeNonZeroStatToStream(const uint64_t fieldId, const int value,
+void writeNonZeroStatToStream(const uint64_t fieldId, const int64_t value,
                               ProtoOutputStream* protoOutput);
 
 // Helper function to write PulledAtomStats to ProtoOutputStream
diff --git a/bin/tests/guardrail/StatsdStats_test.cpp b/bin/tests/guardrail/StatsdStats_test.cpp
index 16ae9b5..5a824c53 100644
--- a/bin/tests/guardrail/StatsdStats_test.cpp
+++ b/bin/tests/guardrail/StatsdStats_test.cpp
@@ -343,16 +343,16 @@
     StatsdStats stats;
     time_t now = time(nullptr);
     // old event, we get it from the stats buffer. should be ignored.
-    stats.noteBucketDropped(1000L);
+    stats.noteBucketDropped(10000000000LL);
 
-    stats.noteLateLogEvent(1000L, 10L);
-    stats.noteLateLogEvent(1000L, 50L);
+    stats.noteLateLogEvent(10000000000LL, 10L);
+    stats.noteLateLogEvent(10000000000LL, 50L);
 
-    stats.noteBucketBoundaryDelayNs(1000L, -1L);
-    stats.noteBucketBoundaryDelayNs(1000L, -10L);
-    stats.noteBucketBoundaryDelayNs(1000L, 2L);
+    stats.noteBucketBoundaryDelayNs(10000000000LL, -1L);
+    stats.noteBucketBoundaryDelayNs(10000000000LL, -10L);
+    stats.noteBucketBoundaryDelayNs(10000000000LL, 2L);
 
-    stats.noteBucketBoundaryDelayNs(1001L, 1L);
+    stats.noteBucketBoundaryDelayNs(10000000001LL, 1L);
 
     vector<uint8_t> output;
     stats.dumpStats(&output, false);
@@ -363,7 +363,7 @@
     ASSERT_EQ(2, report.atom_metric_stats().size());
 
     auto atomStats = report.atom_metric_stats(0);
-    EXPECT_EQ(1000L, atomStats.metric_id());
+    EXPECT_EQ(10000000000LL, atomStats.metric_id());
     EXPECT_EQ(1L, atomStats.bucket_dropped());
     EXPECT_EQ(-10L, atomStats.min_bucket_boundary_delay_ns());
     EXPECT_EQ(2L, atomStats.max_bucket_boundary_delay_ns());
@@ -372,7 +372,7 @@
     EXPECT_EQ(50L, atomStats.max_late_log_event_extra_duration_ns());
 
     auto atomStats2 = report.atom_metric_stats(1);
-    EXPECT_EQ(1001L, atomStats2.metric_id());
+    EXPECT_EQ(10000000001LL, atomStats2.metric_id());
     EXPECT_EQ(0L, atomStats2.bucket_dropped());
     EXPECT_EQ(0L, atomStats2.min_bucket_boundary_delay_ns());
     EXPECT_EQ(1L, atomStats2.max_bucket_boundary_delay_ns());