Snap for 8421339 from c64e3f5bd6 to tm-qpr1-release

Change-Id: Ie04f365e4d887fb7fc50bacf5c8ea67dc44f8644
This commit is contained in:
Android Build Coastguard Worker 2022-04-08 03:01:29 +00:00
commit 519be7ebd1
2 changed files with 19 additions and 3 deletions

View file

@ -29,7 +29,9 @@
<!-- Height of the status bar. <!-- Height of the status bar.
Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead. Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
--> -->
<dimen name="status_bar_height">28dp</dimen> <dimen name="status_bar_height_default">28dp</dimen>
<dimen name="status_bar_height_portrait">145px</dimen>
<dimen name="status_bar_height_landscape">28dp</dimen>
<!-- Adjustment for software rounded corners since corners aren't perfectly round. --> <!-- Adjustment for software rounded corners since corners aren't perfectly round. -->
<dimen name="rounded_corner_radius_adjustment">5px</dimen> <dimen name="rounded_corner_radius_adjustment">5px</dimen>

View file

@ -26,6 +26,7 @@
#include <android/binder_manager.h> #include <android/binder_manager.h>
#include <android/binder_process.h> #include <android/binder_process.h>
#include <log/log.h> #include <log/log.h>
#include <sys/stat.h>
using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider; using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider;
using aidl::android::hardware::power::stats::EnergyConsumerType; using aidl::android::hardware::power::stats::EnergyConsumerType;
@ -54,6 +55,8 @@ void addDisplay(std::shared_ptr<PowerStats> p) {
} }
int main() { int main() {
struct stat buffer;
LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting."; LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting.";
// single thread // single thread
@ -63,8 +66,19 @@ int main() {
addGs101CommonDataProviders(p); addGs101CommonDataProviders(p);
addDisplay(p); addDisplay(p);
if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats", &buffer)) {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats"); addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats");
} else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats", &buffer)) {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats");
} else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats", &buffer)) {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats");
} else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats", &buffer)) {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats");
} else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats", &buffer)) {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats");
} else {
addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-8/i2c-st21nfc/power_stats");
}
const std::string instance = std::string() + PowerStats::descriptor + "/default"; const std::string instance = std::string() + PowerStats::descriptor + "/default";
binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str()); binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str());
LOG_ALWAYS_FATAL_IF(status != STATUS_OK); LOG_ALWAYS_FATAL_IF(status != STATUS_OK);