From da46b392f10d2809b5696632f67485f272ec5698 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 11 Oct 2016 17:09:00 -0700 Subject: Move off std::sto* function which abort on failure. Bug: http://b/31403370 Test: builds, boots, libbase tests pass Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293 --- healthd/BatteryMonitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'healthd') diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index f81e7d9bf..0c90a5456 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -182,7 +183,7 @@ int BatteryMonitor::getIntField(const String8& path) { int value = 0; if (readFromFile(path, &buf) > 0) - value = std::stoi(buf.c_str(), NULL, 0); + android::base::ParseInt(buf, &value); return value; } -- cgit v1.2.3