diff options
author | Vinay Kalia <vinaykalia@google.com> | 2018-10-22 19:21:48 -0700 |
---|---|---|
committer | Benjamin Schwartz <bsschwar@google.com> | 2019-01-07 14:00:10 -0800 |
commit | 3b91fd4ab6945b44ccb450d963a4dd46bf125a2b (patch) | |
tree | 427ff8bf2f814939b22363dce53fc48269b4774f /power | |
parent | f12c171b3a344eade0ca17cc7237a06df5d88aaf (diff) | |
download | android_hardware_interfaces-3b91fd4ab6945b44ccb450d963a4dd46bf125a2b.tar.gz android_hardware_interfaces-3b91fd4ab6945b44ccb450d963a4dd46bf125a2b.tar.bz2 android_hardware_interfaces-3b91fd4ab6945b44ccb450d963a4dd46bf125a2b.zip |
power/stats: Update HIDL to use synchronous FMQ
Unsynchronous queue do not help solve the problem of
supporting multiple clients of power.stats. Since, there
is no current requirement to support multiple clients so
using synchronous queues instead.
BUG: 117424656
BUG: 111185513
Test: run vts -m VtsHalPowerStatsV1_0Target
Change-Id: Iab73de5a460e2a0ec5e949f8b021a87aefed58c8
(cherry picked from commit 84a48b832593d7251311c92f3eb270127c8d909d)
Merged-In: Iab73de5a460e2a0ec5e949f8b021a87aefed58c8
Diffstat (limited to 'power')
-rw-r--r-- | power/stats/1.0/IPowerStats.hal | 18 | ||||
-rw-r--r-- | power/stats/1.0/types.hal | 1 |
2 files changed, 12 insertions, 7 deletions
diff --git a/power/stats/1.0/IPowerStats.hal b/power/stats/1.0/IPowerStats.hal index d75e170a1..b5b3cc9a8 100644 --- a/power/stats/1.0/IPowerStats.hal +++ b/power/stats/1.0/IPowerStats.hal @@ -50,10 +50,13 @@ interface IPowerStats { * asynchronous. * * @param timeMs Time(in ms) for which energyData should be streamed - * @return mqDesc Unsynchronous Fast Message Queue descriptor - One - * writer(power.stats HAL) multiple readers are supported. Reader - * should read faster than writer otherwise data might be - * overwritten. Data is present in following format in the queue: + * @param samplingRate Frequency(in Hz) at which samples should be + * captured. If the requested sampling rate is not supported then + * SUCCESS is returned and numSamples are reported back according + * to the supported sampling rate. + * @return mqDesc Blocking Synchronous Fast Message Queue descriptor - One + * writer(power.stats HAL) and one reader are supported. Data is + * present in the following format in the queue: * +-----------------------+ <-- * | EnergyData for rail 1 | | * +-----------------------+ | @@ -87,9 +90,10 @@ interface IPowerStats { * @return numSamples Number of samples which will be generated in timeMs. * @return railsPerSample Number of rails measured per sample. * @return status SUCCESS on success or FILESYSTEM_ERROR on filesystem - * nodes access or NOT_SUPPORTED if feature is not enabled. + * nodes access or NOT_SUPPORTED if feature is not enabled or + * INSUFFICIENT_RESOURCES if there are not enough resources. */ - streamEnergyData(uint32_t timeMs) - generates(fmq_unsync<EnergyData> mqDesc, uint32_t numSamples, + streamEnergyData(uint32_t timeMs, uint32_t samplingRate) + generates(fmq_sync<EnergyData> mqDesc, uint32_t numSamples, uint32_t railsPerSample, Status status); }; diff --git a/power/stats/1.0/types.hal b/power/stats/1.0/types.hal index 826c29be5..703e5429e 100644 --- a/power/stats/1.0/types.hal +++ b/power/stats/1.0/types.hal @@ -20,6 +20,7 @@ enum Status : uint32_t { NOT_SUPPORTED = 1, INVALID_INPUT = 2, FILESYSTEM_ERROR = 3, + INSUFFICIENT_RESOURCES = 4, }; struct RailInfo { |