diff options
| author | 2018-03-28 23:02:07 +0000 | |
|---|---|---|
| committer | 2018-03-28 23:02:07 +0000 | |
| commit | 04978da7edbe25ddde9e4fe2cfc64baf66cd3ddd (patch) | |
| tree | 3dd02cdb4322b54f605a0f515c9d193dac4f8e3f | |
| parent | f2135d166fc3b459df137df5b6642f015620e4d6 (diff) | |
| parent | 128da7c8739935f38d04b9070650e3367bd98fc9 (diff) | |
Merge "Merge "Temperature atom: Use int instead of float." into pi-dev am: 31c807c987" into pi-dev-plus-aosp
am: 128da7c873
Change-Id: I3ad448137fce55ac5da0be114a78e63627ad05ff
| -rw-r--r-- | cmds/statsd/src/atoms.proto | 7 | ||||
| -rw-r--r-- | cmds/statsd/src/external/ResourceThermalManagerPuller.cpp | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index a6f4bdbcdee6..c8ae42695eb1 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -1943,7 +1943,8 @@ message FullBatteryCapacity { } /** - * Pulls the temperature of various parts of the device, in Celsius. + * Pulls the temperature of various parts of the device. + * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. * * Pulled from: * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp @@ -1955,6 +1956,6 @@ message Temperature { // The name of the temperature source. Eg. CPU0 optional string sensor_name = 2; - // Temperature in degrees C. - optional float temperature_C = 3; + // Temperature in tenths of a degree C. + optional int32 temperature_dC = 3; } diff --git a/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp b/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp index b3acdfcfce33..33a17deabc5a 100644 --- a/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp +++ b/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp @@ -120,7 +120,9 @@ bool ResourceThermalManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* da wallClockTimestampNs, elapsedTimestampNs); ptr->write((static_cast<int>(temps[i].type))); ptr->write(temps[i].name); - ptr->write(temps[i].currentValue); + // Convert the temperature to an int. + int32_t temp = static_cast<int>(temps[i].currentValue * 10); + ptr->write(temp); ptr->init(); data->push_back(ptr); } |