power/stats: Rename PowerStats HAL

Bug: 169864180
Test: m
Change-Id: I6abacd82d9bcbc5957dcad891ae5c742bc307316
This commit is contained in:
Benjamin Schwartz
2020-10-05 15:44:19 -07:00
parent bcd9053514
commit 71c6f8ba6f
29 changed files with 66 additions and 62 deletions

View File

@@ -381,7 +381,7 @@
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.powerstats</name>
<name>android.hardware.power.stats</name>
<interface>
<name>IPowerStats</name>
<instance>default</instance>

View File

@@ -13,10 +13,10 @@
// limitations under the License.
aidl_interface {
name: "android.hardware.powerstats",
name: "android.hardware.power.stats",
vendor_available: true,
srcs: [
"android/hardware/powerstats/*.aidl",
"android/hardware/power/stats/*.aidl",
],
stability: "vintf",
backend: {

View File

@@ -15,7 +15,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable ChannelInfo {
int channelId;

View File

@@ -15,7 +15,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@Backing(type="int") @VintfStability
enum EnergyConsumerId {
DISPLAY = 0,

View File

@@ -15,10 +15,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable EnergyConsumerResult {
android.hardware.powerstats.EnergyConsumerId energyConsumerId;
android.hardware.power.stats.EnergyConsumerId energyConsumerId;
long timestampMs;
long energyUWs;
}

View File

@@ -15,7 +15,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable EnergyMeasurement {
int channelId;

View File

@@ -15,13 +15,13 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
interface IPowerStats {
android.hardware.powerstats.PowerEntityInfo[] getPowerEntityInfo();
android.hardware.powerstats.StateResidencyResult[] getStateResidency(in int[] powerEntityIds);
android.hardware.powerstats.EnergyConsumerId[] getEnergyConsumerInfo();
android.hardware.powerstats.EnergyConsumerResult[] getEnergyConsumed(in android.hardware.powerstats.EnergyConsumerId[] energyConsumerIds);
android.hardware.powerstats.ChannelInfo[] getEnergyMeterInfo();
android.hardware.powerstats.EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
android.hardware.power.stats.PowerEntityInfo[] getPowerEntityInfo();
android.hardware.power.stats.StateResidencyResult[] getStateResidency(in int[] powerEntityIds);
android.hardware.power.stats.EnergyConsumerId[] getEnergyConsumerInfo();
android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(in android.hardware.power.stats.EnergyConsumerId[] energyConsumerIds);
android.hardware.power.stats.ChannelInfo[] getEnergyMeterInfo();
android.hardware.power.stats.EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
}

View File

@@ -15,10 +15,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable PowerEntityInfo {
int powerEntityId;
@utf8InCpp String powerEntityName;
android.hardware.powerstats.StateInfo[] states;
android.hardware.power.stats.StateInfo[] states;
}

View File

@@ -15,7 +15,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable StateInfo {
int stateId;

View File

@@ -15,7 +15,7 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable StateResidency {
int stateId;

View File

@@ -15,9 +15,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable StateResidencyResult {
int powerEntityId;
android.hardware.powerstats.StateResidency[] stateResidencyData;
android.hardware.power.stats.StateResidency[] stateResidencyData;
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable ChannelInfo {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
@Backing(type="int")

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
import android.hardware.powerstats.EnergyConsumerId;
import android.hardware.power.stats.EnergyConsumerId;
@VintfStability
parcelable EnergyConsumerResult {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable EnergyMeasurement {

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
import android.hardware.powerstats.ChannelInfo;
import android.hardware.powerstats.EnergyConsumerId;
import android.hardware.powerstats.EnergyConsumerResult;
import android.hardware.powerstats.EnergyMeasurement;
import android.hardware.powerstats.PowerEntityInfo;
import android.hardware.powerstats.StateResidencyResult;
import android.hardware.power.stats.ChannelInfo;
import android.hardware.power.stats.EnergyConsumerId;
import android.hardware.power.stats.EnergyConsumerResult;
import android.hardware.power.stats.EnergyMeasurement;
import android.hardware.power.stats.PowerEntityInfo;
import android.hardware.power.stats.StateResidencyResult;
@VintfStability
interface IPowerStats {

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
import android.hardware.powerstats.StateInfo;
import android.hardware.power.stats.StateInfo;
@VintfStability
parcelable PowerEntityInfo {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
@VintfStability
parcelable StateInfo {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
/**
* Contains residency data for a single state

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package android.hardware.powerstats;
package android.hardware.power.stats;
import android.hardware.powerstats.StateResidency;
import android.hardware.power.stats.StateResidency;
@VintfStability
parcelable StateResidencyResult {

View File

@@ -13,15 +13,15 @@
// limitations under the License.
cc_binary {
name: "android.hardware.powerstats-service.example",
name: "android.hardware.power.stats-service.example",
relative_install_path: "hw",
init_rc: ["powerstats-default.rc"],
vintf_fragments: ["powerstats-default.xml"],
init_rc: ["power.stats-default.rc"],
vintf_fragments: ["power.stats-default.xml"],
vendor: true,
shared_libs: [
"libbase",
"libbinder_ndk",
"android.hardware.powerstats-ndk_platform",
"android.hardware.power.stats-ndk_platform",
],
srcs: [
"main.cpp",

View File

@@ -21,7 +21,8 @@
namespace aidl {
namespace android {
namespace hardware {
namespace powerstats {
namespace power {
namespace stats {
ndk::ScopedAStatus PowerStats::getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) {
(void)_aidl_return;
@@ -60,7 +61,8 @@ ndk::ScopedAStatus PowerStats::readEnergyMeters(const std::vector<int32_t>& in_c
return ndk::ScopedAStatus::ok();
}
} // namespace powerstats
} // namespace stats
} // namespace power
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@@ -16,17 +16,18 @@
#pragma once
#include <aidl/android/hardware/powerstats/BnPowerStats.h>
#include <aidl/android/hardware/power/stats/BnPowerStats.h>
namespace aidl {
namespace android {
namespace hardware {
namespace powerstats {
namespace power {
namespace stats {
class PowerStats : public BnPowerStats {
public:
PowerStats() = default;
// Methods from aidl::android::hardware::powerstats::IPowerStats
// Methods from aidl::android::hardware::power::stats::IPowerStats
ndk::ScopedAStatus getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) override;
ndk::ScopedAStatus getStateResidency(const std::vector<int32_t>& in_powerEntityIds,
std::vector<StateResidencyResult>* _aidl_return) override;
@@ -38,7 +39,8 @@ class PowerStats : public BnPowerStats {
std::vector<EnergyMeasurement>* _aidl_return) override;
};
} // namespace powerstats
} // namespace stats
} // namespace power
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@@ -20,7 +20,7 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::powerstats::PowerStats;
using aidl::android::hardware::power::stats::PowerStats;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);

View File

@@ -0,0 +1,4 @@
service vendor.power.stats-default /vendor/bin/hw/android.hardware.power.stats-service.example
class hal
user system
group system

View File

@@ -1,6 +1,6 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.powerstats</name>
<name>android.hardware.power.stats</name>
<fqname>IPowerStats/default</fqname>
</hal>
</manifest>

View File

@@ -1,4 +0,0 @@
service vendor.powerstats-default /vendor/bin/hw/android.hardware.powerstats-service.example
class hal
user system
group system

View File

@@ -23,7 +23,7 @@ cc_test {
"libbinder_ndk",
],
static_libs: [
"android.hardware.powerstats-ndk_platform",
"android.hardware.power.stats-ndk_platform",
],
test_suites: [
"general-tests",

View File

@@ -16,16 +16,16 @@
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/powerstats/IPowerStats.h>
#include <aidl/android/hardware/power/stats/IPowerStats.h>
#include <android-base/properties.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::powerstats::ChannelInfo;
using aidl::android::hardware::powerstats::EnergyMeasurement;
using aidl::android::hardware::powerstats::IPowerStats;
using aidl::android::hardware::powerstats::PowerEntityInfo;
using aidl::android::hardware::powerstats::StateResidencyResult;
using aidl::android::hardware::power::stats::ChannelInfo;
using aidl::android::hardware::power::stats::EnergyMeasurement;
using aidl::android::hardware::power::stats::IPowerStats;
using aidl::android::hardware::power::stats::PowerEntityInfo;
using aidl::android::hardware::power::stats::StateResidencyResult;
using ndk::SpAIBinder;