diff --git a/felix/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml b/felix/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml index beb5166..f36ea00 100644 --- a/felix/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml +++ b/felix/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml @@ -23,5 +23,11 @@ Wifi + + Cellular_data + + + Sensor + diff --git a/powerstats/felix/service.cpp b/powerstats/felix/service.cpp index 2ccabb0..2de3797 100644 --- a/powerstats/felix/service.cpp +++ b/powerstats/felix/service.cpp @@ -28,6 +28,7 @@ #include #include #include +#include using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider; using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider; @@ -140,6 +141,18 @@ void addGPU(std::shared_ptr p) { stateCoeffs)); } +std::string getNfcPath() { + struct stat buffer; + int size = 128; + char path[size]; + for (int i = 0; i < 10; i++) { + std::snprintf(path, size, + "/sys/devices/platform/10970000.hsi2c/i2c-%d/i2c-st21nfc/power_stats", i); + if (!stat(path, &buffer)) break; + } + return std::string(path); +} + int main() { LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting."; @@ -160,7 +173,7 @@ int main() { addWifi(p); addTPU(p); addUfs(p); - addNFC(p, "/sys/devices/platform/10970000.hsi2c/i2c-4/i2c-st21nfc/power_stats"); + addNFC(p, getNfcPath()); addUwb(p); addPowerDomains(p); addDevfreq(p); diff --git a/rro_overlays/WifiOverlay/res/values/config.xml b/rro_overlays/WifiOverlay/res/values/config.xml index fe8976a..94f377b 100644 --- a/rro_overlays/WifiOverlay/res/values/config.xml +++ b/rro_overlays/WifiOverlay/res/values/config.xml @@ -158,11 +158,6 @@ is when the system is in the suspended mode --> true - - true - true diff --git a/thermal_info_config_felix.json b/thermal_info_config_felix.json index 3920569..45fcea5 100644 --- a/thermal_info_config_felix.json +++ b/thermal_info_config_felix.json @@ -977,5 +977,25 @@ "PowerSampleDelay":60000, "PowerSampleCount":1 } - ] + ], + "Stats": { + "Sensors": { + "RecordWithDefaultThreshold": ["VIRTUAL-SKIN"], + "RecordWithThreshold": [ + { + "Name": "VIRTUAL-SKIN", + "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Thresholds": [2.0] + } + ] + }, + "CoolingDevices": { + "RecordVotePerSensor": { + "DefaultThresholdEnableAll": true + } + } + } }