Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe5d3986 authored by Harpreet \"Eli\" Sangha's avatar Harpreet \"Eli\" Sangha Committed by Harpreet "Eli" Sangha
Browse files

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: default avatarHarpreet \"Eli\" Sangha <eliptus@google.com>
parent 523e2960
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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,
}
+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ ndk::ScopedAStatus Vibrator::getSupportedPrimitives(std::vector<CompositePrimiti
            CompositePrimitive::NOOP,       CompositePrimitive::CLICK,
            CompositePrimitive::THUD,       CompositePrimitive::SPIN,
            CompositePrimitive::QUICK_RISE, CompositePrimitive::SLOW_RISE,
            CompositePrimitive::QUICK_FALL,
            CompositePrimitive::QUICK_FALL, CompositePrimitive::LIGHT_TICK,
    };
    return ndk::ScopedAStatus::ok();
}
@@ -147,7 +147,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect>& 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);
        }
    }