summaryrefslogtreecommitdiff
path: root/vibrator
diff options
context:
space:
mode:
authorVince Leung <leungv@google.com>2021-03-11 05:15:37 +0000
committerVince Leung <leungv@google.com>2021-03-20 05:15:43 +0000
commitd511cc3f586de4433ebd5924d104bbaabc4beb65 (patch)
tree63ddedbc25790b460902e23284984362c9e981dd /vibrator
parenta85522aa5aebb90e5fb50461e39e24178d9048c0 (diff)
downloadbramble-d511cc3f586de4433ebd5924d104bbaabc4beb65.tar.gz
vibrator: implement chirp APIs
Implement the chirp APIs and necessary helper methods. This capability is not supported on drv2624 so we return EX_UNSUPPORTED_OPERATION. Bug: 162859057 Test: m Change-Id: Ibcf28b10f9313d94379103cafcf0400afc7b33b4
Diffstat (limited to 'vibrator')
-rw-r--r--vibrator/drv2624/Vibrator.cpp29
-rw-r--r--vibrator/drv2624/Vibrator.h8
2 files changed, 37 insertions, 0 deletions
diff --git a/vibrator/drv2624/Vibrator.cpp b/vibrator/drv2624/Vibrator.cpp
index d7b54de..1328349 100644
--- a/vibrator/drv2624/Vibrator.cpp
+++ b/vibrator/drv2624/Vibrator.cpp
@@ -687,6 +687,35 @@ ndk::ScopedAStatus Vibrator::getQFactor(float * /*qFactor*/) {
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
+ndk::ScopedAStatus Vibrator::getFrequencyResolution(float * /*freqResolutionHz*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getFrequencyMinimum(float * /*freqMinimumHz*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getBandwidthAmplitudeMap(std::vector<float> * /*_aidl_return*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getPwlePrimitiveDurationMax(int32_t * /*durationMs*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getPwleCompositionSizeMax(int32_t * /*maxSize*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::getSupportedBraking(std::vector<Braking> * /*supported*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+ndk::ScopedAStatus Vibrator::composePwle(const std::vector<PrimitivePwle> & /*composite*/,
+ const std::shared_ptr<IVibratorCallback> & /*callback*/) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
} // namespace vibrator
} // namespace hardware
} // namespace android
diff --git a/vibrator/drv2624/Vibrator.h b/vibrator/drv2624/Vibrator.h
index 9b5e630..0f0ac37 100644
--- a/vibrator/drv2624/Vibrator.h
+++ b/vibrator/drv2624/Vibrator.h
@@ -175,6 +175,14 @@ class Vibrator : public BnVibrator {
ndk::ScopedAStatus alwaysOnDisable(int32_t id) override;
ndk::ScopedAStatus getResonantFrequency(float *resonantFreqHz) override;
ndk::ScopedAStatus getQFactor(float *qFactor) override;
+ ndk::ScopedAStatus getFrequencyResolution(float *freqResolutionHz) override;
+ ndk::ScopedAStatus getFrequencyMinimum(float *freqMinimumHz) override;
+ ndk::ScopedAStatus getBandwidthAmplitudeMap(std::vector<float> *_aidl_return) override;
+ ndk::ScopedAStatus getPwlePrimitiveDurationMax(int32_t *durationMs) override;
+ ndk::ScopedAStatus getPwleCompositionSizeMax(int32_t *maxSize) override;
+ ndk::ScopedAStatus getSupportedBraking(std::vector<Braking> *supported) override;
+ ndk::ScopedAStatus composePwle(const std::vector<PrimitivePwle> &composite,
+ const std::shared_ptr<IVibratorCallback> &callback) override;
binder_status_t dump(int fd, const char **args, uint32_t numArgs) override;