[TeX] Improved readability for Histogram metric APIs
Bug: 268161449
Test: atest expresslog_test
Change-Id: Idd83ca6ec47288ca6ef7ecce333ceb3c88dd761a
diff --git a/libstats/expresslog/Histogram.cpp b/libstats/expresslog/Histogram.cpp
index c90282d..cb29a00 100644
--- a/libstats/expresslog/Histogram.cpp
+++ b/libstats/expresslog/Histogram.cpp
@@ -26,8 +26,8 @@
namespace android {
namespace expresslog {
-Histogram::UniformOptions* Histogram::UniformOptions::create(int binCount, float minValue,
- float exclusiveMaxValue) {
+std::shared_ptr<Histogram::UniformOptions> Histogram::UniformOptions::create(
+ int binCount, float minValue, float exclusiveMaxValue) {
if (binCount < 1) {
ALOGE("Bin count should be positive number");
return nullptr;
@@ -38,7 +38,8 @@
return nullptr;
}
- return new UniformOptions(binCount, minValue, exclusiveMaxValue);
+ return std::shared_ptr<UniformOptions>(
+ new UniformOptions(binCount, minValue, exclusiveMaxValue));
}
Histogram::UniformOptions::UniformOptions(int binCount, float minValue, float exclusiveMaxValue)