Snap for 11251507 from e06316882e
to 24Q2-release
Change-Id: I77425096248e04656b63ea1d0778515680560c51
This commit is contained in:
commit
5226988f25
2 changed files with 57 additions and 41 deletions
|
@ -26,6 +26,7 @@
|
|||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include <log/log.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
|
||||
using aidl::android::hardware::power::stats::EnergyConsumerType;
|
||||
|
@ -33,6 +34,9 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
|||
|
||||
void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||
// Add display residency stats
|
||||
struct stat buffer;
|
||||
if (stat("/sys/class/backlight/panel0-backlight/time_in_state", &buffer)) {
|
||||
// time_in_state doesn't exist
|
||||
std::vector<std::string> states = {
|
||||
"Off",
|
||||
"LP: 1008x2244@1",
|
||||
|
@ -64,6 +68,10 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
|
|||
"Display",
|
||||
"/sys/class/backlight/panel0-backlight/state",
|
||||
states));
|
||||
} else {
|
||||
// time_in_state exists
|
||||
addDisplayMRR(p);
|
||||
}
|
||||
|
||||
// Add display energy consumer
|
||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include <log/log.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
|
||||
using aidl::android::hardware::power::stats::EnergyConsumerType;
|
||||
|
@ -33,6 +34,9 @@ using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
|||
|
||||
void addDisplay(std::shared_ptr<PowerStats> p) {
|
||||
// Add display residency stats
|
||||
struct stat buffer;
|
||||
if (stat("/sys/class/backlight/panel0-backlight/time_in_state", &buffer)) {
|
||||
// time_in_state doesn't exist
|
||||
std::vector<std::string> states = {
|
||||
"Off",
|
||||
"LP: 1080x2400@30",
|
||||
|
@ -45,6 +49,10 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
|
|||
"Display",
|
||||
"/sys/class/backlight/panel0-backlight/state",
|
||||
states));
|
||||
} else {
|
||||
// time_in_state exists
|
||||
addDisplayMRR(p);
|
||||
}
|
||||
|
||||
// Add display energy consumer
|
||||
p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue