summaryrefslogtreecommitdiff
path: root/vibrator/aidl/default/Vibrator.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-11-05 14:30:17 -0800
committerSteven Moreland <smoreland@google.com>2019-11-06 16:34:37 +0000
commit2932b225715a61c7337fc924d263667fbb94aacf (patch)
treedd1b16d6f971f1f983a521cfa8cc1e0dec5c852e /vibrator/aidl/default/Vibrator.cpp
parentde18b338f87294ec594fb59de2daaa544b6d5682 (diff)
vibrator: add getSupportedEffects
It's a real gap in this interface, since we need to call perform to understand if an effect is supported. Bug: 141828236 Test: atest VtsHalVibratorTargetTest Change-Id: Iffbd9c0acf5e4c368767c7718025a4aef8f44ce3
Diffstat (limited to 'vibrator/aidl/default/Vibrator.cpp')
-rw-r--r--vibrator/aidl/default/Vibrator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/vibrator/aidl/default/Vibrator.cpp b/vibrator/aidl/default/Vibrator.cpp
index cdf8e0963b..2aec8c507c 100644
--- a/vibrator/aidl/default/Vibrator.cpp
+++ b/vibrator/aidl/default/Vibrator.cpp
@@ -78,6 +78,11 @@ ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength strength,
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Vibrator::getSupportedEffects(std::vector<Effect>* _aidl_return) {
+ *_aidl_return = {Effect::CLICK, Effect::TICK};
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus Vibrator::setAmplitude(int32_t amplitude) {
LOG(INFO) << "Vibrator set amplitude: " << amplitude;
if (amplitude <= 0 || amplitude > 255) {