power/stats: Rename readEnergyMeters to readEnergyMeter

Bug: 135067502
Test: build
Change-Id: I76e73668faf248ca33a37eb221973d2164d9c9b8
This commit is contained in:
Benjamin Schwartz 2021-02-03 12:55:39 -08:00
parent dbdfdc85c8
commit 77e678ce59
5 changed files with 10 additions and 10 deletions

View file

@ -38,5 +38,5 @@ interface IPowerStats {
android.hardware.power.stats.EnergyConsumer[] getEnergyConsumerInfo();
android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(in int[] energyConsumerIds);
android.hardware.power.stats.Channel[] getEnergyMeterInfo();
android.hardware.power.stats.EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
android.hardware.power.stats.EnergyMeasurement[] readEnergyMeter(in int[] channelIds);
}

View file

@ -107,5 +107,5 @@ interface IPowerStats {
* - STATUS_BAD_VALUE if an invalid channelId is provided
* - STATUS_FAILED_TRANSACTION if any EnergyMeasurement fails to be returned
*/
EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
}
EnergyMeasurement[] readEnergyMeter(in int[] channelIds);
}

View file

@ -53,8 +53,8 @@ ndk::ScopedAStatus PowerStats::getEnergyMeterInfo(std::vector<Channel>* _aidl_re
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus PowerStats::readEnergyMeters(const std::vector<int32_t>& in_channelIds,
std::vector<EnergyMeasurement>* _aidl_return) {
ndk::ScopedAStatus PowerStats::readEnergyMeter(const std::vector<int32_t>& in_channelIds,
std::vector<EnergyMeasurement>* _aidl_return) {
(void)in_channelIds;
(void)_aidl_return;
return ndk::ScopedAStatus::ok();

View file

@ -35,8 +35,8 @@ class PowerStats : public BnPowerStats {
ndk::ScopedAStatus getEnergyConsumed(const std::vector<int32_t>& in_energyConsumerIds,
std::vector<EnergyConsumerResult>* _aidl_return) override;
ndk::ScopedAStatus getEnergyMeterInfo(std::vector<Channel>* _aidl_return) override;
ndk::ScopedAStatus readEnergyMeters(const std::vector<int32_t>& in_channelIds,
std::vector<EnergyMeasurement>* _aidl_return) override;
ndk::ScopedAStatus readEnergyMeter(const std::vector<int32_t>& in_channelIds,
std::vector<EnergyMeasurement>* _aidl_return) override;
};
} // namespace stats

View file

@ -262,7 +262,7 @@ TEST_P(PowerStatsAidl, ValidateChannelUniqueIds) {
// Reading energy meter must return a valid status
TEST_P(PowerStatsAidl, TestReadEnergyMeter) {
std::vector<EnergyMeasurement> data;
ASSERT_TRUE(powerstats->readEnergyMeters({}, &data).isOk());
ASSERT_TRUE(powerstats->readEnergyMeter({}, &data).isOk());
}
// Reading energy meter must return results for all available channels
@ -271,7 +271,7 @@ TEST_P(PowerStatsAidl, TestGetAllEnergyMeasurements) {
ASSERT_TRUE(powerstats->getEnergyMeterInfo(&channels).isOk());
std::vector<EnergyMeasurement> measurements;
ASSERT_TRUE(powerstats->readEnergyMeters({}, &measurements).isOk());
ASSERT_TRUE(powerstats->readEnergyMeter({}, &measurements).isOk());
testMatching(channels, &Channel::id, measurements, &EnergyMeasurement::id);
}
@ -291,7 +291,7 @@ TEST_P(PowerStatsAidl, TestGetSelectedEnergyMeasurements) {
}
std::vector<EnergyMeasurement> selectedMeasurements;
ASSERT_TRUE(powerstats->readEnergyMeters(selectedIds, &selectedMeasurements).isOk());
ASSERT_TRUE(powerstats->readEnergyMeter(selectedIds, &selectedMeasurements).isOk());
testMatching(selectedChannels, &Channel::id, selectedMeasurements, &EnergyMeasurement::id);
}