diff --git a/vibrator/1.3/example/Vibrator.cpp b/vibrator/1.3/example/Vibrator.cpp
index 0cb37e6..b529437 100644
--- a/vibrator/1.3/example/Vibrator.cpp
+++ b/vibrator/1.3/example/Vibrator.cpp
@@ -56,27 +56,30 @@
 }
 
 Return<Status> Vibrator::setAmplitude(uint8_t amplitude) {
+    if (!amplitude) {
+        return Status::BAD_VALUE;
+    }
     ALOGI("Amplitude: %u -> %u\n", mAmplitude, amplitude);
     mAmplitude = amplitude;
     return Status::OK;
 }
 
 Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
-    return perform_1_1(static_cast<V1_1::Effect_1_1>(effect), strength, _hidl_cb);
+    return perform<decltype(effect)>(effect, strength, _hidl_cb);
 }
 
 // Methods from ::android::hardware::vibrator::V1_1::IVibrator follow.
 
 Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
                                    perform_cb _hidl_cb) {
-    return perform_1_2(static_cast<V1_2::Effect>(effect), strength, _hidl_cb);
+    return perform<decltype(effect)>(effect, strength, _hidl_cb);
 }
 
 // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
 
 Return<void> Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength,
                                    perform_cb _hidl_cb) {
-    return perform_1_3(static_cast<V1_3::Effect>(effect), strength, _hidl_cb);
+    return perform<decltype(effect)>(effect, strength, _hidl_cb);
 }
 
 // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
@@ -98,6 +101,12 @@
 }
 
 Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
+    return perform<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+// Private methods follow.
+
+Return<void> Vibrator::perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
     uint8_t amplitude;
     uint32_t ms;
     Status status = Status::OK;
@@ -123,7 +132,15 @@
     return Void();
 }
 
-// Private methods follow.
+template <typename T>
+Return<void> Vibrator::perform(T effect, EffectStrength strength, perform_cb _hidl_cb) {
+    auto validRange = hidl_enum_range<T>();
+    if (effect < *validRange.begin() || effect > *std::prev(validRange.end())) {
+        _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
+        return Void();
+    }
+    return perform(static_cast<Effect>(effect), strength, _hidl_cb);
+}
 
 Status Vibrator::enable(bool enabled) {
     if (mExternalControl) {
diff --git a/vibrator/1.3/example/Vibrator.h b/vibrator/1.3/example/Vibrator.h
index 64e8e1b..5180774 100644
--- a/vibrator/1.3/example/Vibrator.h
+++ b/vibrator/1.3/example/Vibrator.h
@@ -54,6 +54,9 @@
     Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
 
   private:
+    Return<void> perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
+    template <typename T>
+    Return<void> perform(T effect, EffectStrength strength, perform_cb _hidl_cb);
     Status enable(bool enabled);
     Status activate(uint32_t ms);
     void timeout();
