From fe5d3986e9f170f6f0c04dbf9e40bcb5646922f9 Mon Sep 17 00:00:00 2001 From: "Harpreet \\\"Eli\\\" Sangha" Date: Fri, 17 Jan 2020 14:46:37 +0900 Subject: [PATCH] vibrator: Add "Light Tick" Primitive Bug: 147844633 Test: adb shell idlcli vibrator compose 0 7 1.0 Change-Id: I208e56011f790c095afe734fd4326de10078525a Merged-In: I208e56011f790c095afe734fd4326de10078525a Signed-off-by: Harpreet \"Eli\" Sangha --- .../aidl/android/hardware/vibrator/CompositePrimitive.aidl | 5 +++++ vibrator/aidl/default/Vibrator.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vibrator/aidl/android/hardware/vibrator/CompositePrimitive.aidl b/vibrator/aidl/android/hardware/vibrator/CompositePrimitive.aidl index b9a80ec116..0fdfa5d5c2 100644 --- a/vibrator/aidl/android/hardware/vibrator/CompositePrimitive.aidl +++ b/vibrator/aidl/android/hardware/vibrator/CompositePrimitive.aidl @@ -49,4 +49,9 @@ enum CompositePrimitive { * A haptic effect that simulates quick downwards movement with gravity. */ QUICK_FALL, + /** + * This very short effect should produce a light crisp sensation intended + * to be used repetitively for dynamic feedback. + */ + LIGHT_TICK, } diff --git a/vibrator/aidl/default/Vibrator.cpp b/vibrator/aidl/default/Vibrator.cpp index d6ce8a1c43..0d7131aaf8 100644 --- a/vibrator/aidl/default/Vibrator.cpp +++ b/vibrator/aidl/default/Vibrator.cpp @@ -118,7 +118,7 @@ ndk::ScopedAStatus Vibrator::getSupportedPrimitives(std::vector& composi return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (e.primitive < CompositePrimitive::NOOP || - e.primitive > CompositePrimitive::QUICK_FALL) { + e.primitive > CompositePrimitive::LIGHT_TICK) { return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } }