Move power stats service to device specific folders
Bug: 183052760 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: I4d4881e227982aa17b88af8844c82dc448ef5b6f Merged-In: I4d4881e227982aa17b88af8844c82dc448ef5b6f
This commit is contained in:
parent
1a1a12cd55
commit
3c712491cf
5 changed files with 33 additions and 49 deletions
|
@ -22,30 +22,17 @@ package {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_binary {
|
cc_library {
|
||||||
name: "android.hardware.power.stats-service.pixel",
|
name: "android.hardware.power.stats-impl.gs101",
|
||||||
init_rc: ["android.hardware.power.stats-service.pixel.rc"],
|
vendor_available: true,
|
||||||
vintf_fragments: ["android.hardware.power.stats-service.pixel.xml"],
|
export_include_dirs: ["include"],
|
||||||
|
defaults: ["powerstats_pixel_defaults"],
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
"*.cpp",
|
"*.cpp",
|
||||||
],
|
],
|
||||||
cflags: [
|
|
||||||
"-Wall",
|
shared_libs: [
|
||||||
"-Werror",
|
|
||||||
],
|
|
||||||
static_libs: [
|
|
||||||
"android.hardware.power.stats-impl.pixel",
|
"android.hardware.power.stats-impl.pixel",
|
||||||
],
|
],
|
||||||
shared_libs: [
|
|
||||||
"libbase",
|
|
||||||
"libcutils",
|
|
||||||
"liblog",
|
|
||||||
"libutils",
|
|
||||||
"libbinder_ndk",
|
|
||||||
"pixel_stateresidency_provider_aidl_interface-ndk_platform",
|
|
||||||
"android.hardware.power.stats-V1-ndk_platform",
|
|
||||||
],
|
|
||||||
relative_install_path: "hw",
|
|
||||||
vendor: true,
|
|
||||||
proprietary: true,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,8 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "android.hardware.power.stats-service.pixel"
|
|
||||||
|
|
||||||
#include <PowerStatsAidl.h>
|
#include <PowerStatsAidl.h>
|
||||||
|
#include <Gs101CommonDataProviders.h>
|
||||||
#include "AocStateResidencyDataProvider.h"
|
#include "AocStateResidencyDataProvider.h"
|
||||||
#include "DvfsStateResidencyDataProvider.h"
|
#include "DvfsStateResidencyDataProvider.h"
|
||||||
#include "UfsStateResidencyDataProvider.h"
|
#include "UfsStateResidencyDataProvider.h"
|
||||||
|
@ -41,7 +40,6 @@ using aidl::android::hardware::power::stats::EnergyConsumerType;
|
||||||
using aidl::android::hardware::power::stats::GenericStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::GenericStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::IioEnergyMeterDataProvider;
|
using aidl::android::hardware::power::stats::IioEnergyMeterDataProvider;
|
||||||
using aidl::android::hardware::power::stats::PixelStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::PixelStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::PowerStats;
|
|
||||||
using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
using aidl::android::hardware::power::stats::PowerStatsEnergyConsumer;
|
||||||
|
|
||||||
constexpr char kBootHwSoCRev[] = "ro.boot.hw.soc.rev";
|
constexpr char kBootHwSoCRev[] = "ro.boot.hw.soc.rev";
|
||||||
|
@ -575,14 +573,7 @@ void addPixelStateResidencyDataProvider(std::shared_ptr<PowerStats> p) {
|
||||||
p->addStateResidencyDataProvider(std::move(pixelSdp));
|
p->addStateResidencyDataProvider(std::move(pixelSdp));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
void addGs101CommonDataProviders(std::shared_ptr<PowerStats> p) {
|
||||||
LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting.";
|
|
||||||
|
|
||||||
// single thread
|
|
||||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
|
||||||
|
|
||||||
std::shared_ptr<PowerStats> p = ndk::SharedRefBase::make<PowerStats>();
|
|
||||||
|
|
||||||
setEnergyMeter(p);
|
setEnergyMeter(p);
|
||||||
|
|
||||||
addPixelStateResidencyDataProvider(p);
|
addPixelStateResidencyDataProvider(p);
|
||||||
|
@ -602,11 +593,4 @@ int main() {
|
||||||
// TODO (b/181070764) (b/182941084):
|
// TODO (b/181070764) (b/182941084):
|
||||||
// Remove this when Wifi/BT energy consumption models are available or revert before ship
|
// Remove this when Wifi/BT energy consumption models are available or revert before ship
|
||||||
addPlaceholderEnergyConsumers(p);
|
addPlaceholderEnergyConsumers(p);
|
||||||
|
|
||||||
const std::string instance = std::string() + PowerStats::descriptor + "/default";
|
|
||||||
binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str());
|
|
||||||
LOG_ALWAYS_FATAL_IF(status != STATUS_OK);
|
|
||||||
|
|
||||||
ABinderProcess_joinThreadPool();
|
|
||||||
return EXIT_FAILURE; // should not reach
|
|
||||||
}
|
}
|
|
@ -1,4 +0,0 @@
|
||||||
service vendor.power.stats.pixel /vendor/bin/hw/android.hardware.power.stats-service.pixel
|
|
||||||
class hal
|
|
||||||
user system
|
|
||||||
group system
|
|
|
@ -1,6 +0,0 @@
|
||||||
<manifest version="1.0" type="device">
|
|
||||||
<hal format="aidl">
|
|
||||||
<name>android.hardware.power.stats</name>
|
|
||||||
<fqname>IPowerStats/default</fqname>
|
|
||||||
</hal>
|
|
||||||
</manifest>
|
|
23
powerstats/include/Gs101CommonDataProviders.h
Normal file
23
powerstats/include/Gs101CommonDataProviders.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <PowerStatsAidl.h>
|
||||||
|
|
||||||
|
using aidl::android::hardware::power::stats::PowerStats;
|
||||||
|
|
||||||
|
void addGs101CommonDataProviders(std::shared_ptr<PowerStats> p);
|
Loading…
Add table
Add a link
Reference in a new issue