Snap for 11373247 from b9438cfd24
to 24Q2-release
Change-Id: I20c19dbaa130fc58f0745839c50d412f352f073b
This commit is contained in:
commit
1d3aa4f55d
1 changed files with 17 additions and 10 deletions
|
@ -34,6 +34,12 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
||||||
|
|
||||||
void addDisplay(std::shared_ptr<PowerStats> p) {
|
void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||||
// Add display residency stats
|
// Add display residency stats
|
||||||
|
struct stat buffer;
|
||||||
|
if (!stat("/sys/class/drm/card0/device/primary-panel/time_in_state", &buffer)) {
|
||||||
|
// time_in_state exists
|
||||||
|
addDisplayMrr(p);
|
||||||
|
} else {
|
||||||
|
// time_in_state doesn't exist
|
||||||
std::vector<std::string> states = {
|
std::vector<std::string> states = {
|
||||||
"Off",
|
"Off",
|
||||||
"LP: 1080x2400@30",
|
"LP: 1080x2400@30",
|
||||||
|
@ -45,6 +51,7 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||||
"Display",
|
"Display",
|
||||||
"/sys/class/backlight/panel0-backlight/state",
|
"/sys/class/backlight/panel0-backlight/state",
|
||||||
states));
|
states));
|
||||||
|
}
|
||||||
|
|
||||||
// Add display energy consumer
|
// Add display energy consumer
|
||||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(
|
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndEntityConsumer(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue