Adapt to google::protobuf::uint64 type change
Protobuf 3.9.1 redefines google::protobuf::uint64 from unsigned long
long to uint64_t, which is sometimes unsigned long and sometimes
unsigned long long. Use PRIu64 to print it, and add an implementation
of ProtoOutputStream::write for long.
Bug: 117607748
Test: m checkbuild
Exempt-From-Owner-Approval: approved at https://android-review.googlesource.com/q/Ib2d3f4e17857f8ccbbe342ce6678e76b591df510
Change-Id: Ib2d3f4e17857f8ccbbe342ce6678e76b591df510
diff --git a/cmds/statsd/src/anomaly/AnomalyTracker.cpp b/cmds/statsd/src/anomaly/AnomalyTracker.cpp
index d1dcb5df..7ace44e 100644
--- a/cmds/statsd/src/anomaly/AnomalyTracker.cpp
+++ b/cmds/statsd/src/anomaly/AnomalyTracker.cpp
@@ -24,6 +24,7 @@
#include "subscriber/IncidentdReporter.h"
#include "subscriber/SubscriberReporter.h"
+#include <inttypes.h>
#include <statslog.h>
#include <time.h>
@@ -224,7 +225,7 @@
}
if (!mSubscriptions.empty()) {
- ALOGI("An anomaly (%lld) %s has occurred! Informing subscribers.",
+ ALOGI("An anomaly (%" PRId64 ") %s has occurred! Informing subscribers.",
mAlert.id(), key.toString().c_str());
informSubscribers(key, metricId, metricValue);
} else {