Loading cmds/statsd/src/atoms.proto +12 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ message Atom { DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040; DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041; ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042; BatteryLevel battery_level = 10043; } // DO NOT USE field numbers above 100,000 in AOSP. Loading Loading @@ -2678,6 +2679,17 @@ message BatteryVoltage { optional int32 voltage_millivolt = 1; } /** * Pulls battery level (percent full, from 0 to 100). * * Pulled from: * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp */ message BatteryLevel { // Battery level. Should be in [0, 100]. optional int32 battery_level = 1; } /** * Pulls the temperature of various parts of the device. * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. Loading cmds/statsd/src/external/ResourceHealthManagerPuller.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,12 @@ bool ResourceHealthManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* dat ptr->write(v.legacy.batteryVoltage); ptr->init(); data->push_back(ptr); } else if (mTagId == android::util::BATTERY_LEVEL) { auto ptr = make_shared<LogEvent>(android::util::BATTERY_LEVEL, wallClockTimestampNs, elapsedTimestampNs); ptr->write(v.legacy.batteryLevel); ptr->init(); data->push_back(ptr); } else { ALOGE("Unsupported tag in ResourceHealthManagerPuller: %d", mTagId); } Loading cmds/statsd/src/external/StatsPullerManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,9 @@ const std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = { // battery_voltage {android::util::BATTERY_VOLTAGE, {{}, {}, 1 * NS_PER_SEC, new ResourceHealthManagerPuller(android::util::BATTERY_VOLTAGE)}}, // battery_voltage {android::util::BATTERY_LEVEL, {{}, {}, 1 * NS_PER_SEC, new ResourceHealthManagerPuller(android::util::BATTERY_LEVEL)}}, // process_memory_state {android::util::PROCESS_MEMORY_STATE, {{4, 5, 6, 7, 8, 9}, Loading Loading
cmds/statsd/src/atoms.proto +12 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ message Atom { DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040; DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041; ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042; BatteryLevel battery_level = 10043; } // DO NOT USE field numbers above 100,000 in AOSP. Loading Loading @@ -2678,6 +2679,17 @@ message BatteryVoltage { optional int32 voltage_millivolt = 1; } /** * Pulls battery level (percent full, from 0 to 100). * * Pulled from: * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp */ message BatteryLevel { // Battery level. Should be in [0, 100]. optional int32 battery_level = 1; } /** * Pulls the temperature of various parts of the device. * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. Loading
cmds/statsd/src/external/ResourceHealthManagerPuller.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,12 @@ bool ResourceHealthManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* dat ptr->write(v.legacy.batteryVoltage); ptr->init(); data->push_back(ptr); } else if (mTagId == android::util::BATTERY_LEVEL) { auto ptr = make_shared<LogEvent>(android::util::BATTERY_LEVEL, wallClockTimestampNs, elapsedTimestampNs); ptr->write(v.legacy.batteryLevel); ptr->init(); data->push_back(ptr); } else { ALOGE("Unsupported tag in ResourceHealthManagerPuller: %d", mTagId); } Loading
cmds/statsd/src/external/StatsPullerManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,9 @@ const std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = { // battery_voltage {android::util::BATTERY_VOLTAGE, {{}, {}, 1 * NS_PER_SEC, new ResourceHealthManagerPuller(android::util::BATTERY_VOLTAGE)}}, // battery_voltage {android::util::BATTERY_LEVEL, {{}, {}, 1 * NS_PER_SEC, new ResourceHealthManagerPuller(android::util::BATTERY_LEVEL)}}, // process_memory_state {android::util::PROCESS_MEMORY_STATE, {{4, 5, 6, 7, 8, 9}, Loading