Add new TEXTURE_TICK constant.

Unlike TICK, this is specifically meant to be called repeatedly in
reaction to small movements in order to replicate a specific texture.

Bug: 111461797
Test: VTS
Change-Id: If21687b5fed5f578a638017abc9ce479a122612d
diff --git a/vibrator/1.3/example/Vibrator.cpp b/vibrator/1.3/example/Vibrator.cpp
index bb9a057..eb50187 100644
--- a/vibrator/1.3/example/Vibrator.cpp
+++ b/vibrator/1.3/example/Vibrator.cpp
@@ -74,22 +74,9 @@
 
 // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
 
-Return<void> Vibrator::perform_1_2(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
-    uint8_t amplitude;
-    uint32_t ms;
-    Status status;
-
-    ALOGI("Perform: Effect %s\n", effectToName(effect));
-
-    amplitude = strengthToAmplitude(strength);
-    setAmplitude(amplitude);
-
-    ms = effectToMs(effect);
-    status = activate(ms);
-
-    _hidl_cb(status, ms);
-
-    return Void();
+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);
 }
 
 // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
@@ -110,6 +97,24 @@
     }
 }
 
+Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
+    uint8_t amplitude;
+    uint32_t ms;
+    Status status;
+
+    ALOGI("Perform: Effect %s\n", effectToName(effect));
+
+    amplitude = strengthToAmplitude(strength);
+    setAmplitude(amplitude);
+
+    ms = effectToMs(effect);
+    status = activate(ms);
+
+    _hidl_cb(status, ms);
+
+    return Void();
+}
+
 // Private methods follow.
 
 Status Vibrator::enable(bool enabled) {
@@ -184,6 +189,7 @@
         case Effect::DOUBLE_CLICK:
             return 15;
         case Effect::TICK:
+        case Effect::TEXTURE_TICK:
             return 5;
         case Effect::THUD:
             return 5;
diff --git a/vibrator/1.3/example/Vibrator.h b/vibrator/1.3/example/Vibrator.h
index a931b63..8cf0b1e 100644
--- a/vibrator/1.3/example/Vibrator.h
+++ b/vibrator/1.3/example/Vibrator.h
@@ -27,7 +27,6 @@
 
 using android::hardware::vibrator::V1_0::EffectStrength;
 using android::hardware::vibrator::V1_0::Status;
-using android::hardware::vibrator::V1_2::Effect;
 
 class Vibrator : public IVibrator {
   public:
@@ -46,11 +45,13 @@
                              perform_cb _hidl_cb) override;
 
     // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
-    Return<void> perform_1_2(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
+    Return<void> perform_1_2(V1_2::Effect effect, EffectStrength strength,
+                             perform_cb _hidl_cb) override;
 
     // Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
     Return<bool> supportsExternalControl() override;
     Return<Status> setExternalControl(bool enabled) override;
+    Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
 
   private:
     Status enable(bool enabled);