diff --git a/hidl/vibrator/Android.bp b/hidl/vibrator/Android.bp
new file mode 100644
index 0000000..2eca7e2
--- /dev/null
+++ b/hidl/vibrator/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2020 The LineageOS Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_binary {
+    name: "android.hardware.vibrator@1.3-service.samsung",
+    defaults: ["hidl_defaults"],
+    vendor: true,
+    relative_install_path: "hw",
+    init_rc: ["android.hardware.vibrator@1.3-service.samsung.rc"],
+    vintf_fragments: ["android.hardware.vibrator@1.3-service.samsung.xml"],
+    srcs: ["service.cpp", "Vibrator.cpp"],
+    cflags: ["-Wall", "-Wextra", "-Werror"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "liblog",
+        "libutils",
+        "libhardware",
+        "android.hardware.vibrator@1.0",
+        "android.hardware.vibrator@1.1",
+        "android.hardware.vibrator@1.2",
+        "android.hardware.vibrator@1.3",
+    ],
+}
diff --git a/hidl/vibrator/Vibrator.cpp b/hidl/vibrator/Vibrator.cpp
new file mode 100644
index 0000000..110ca9d
--- /dev/null
+++ b/hidl/vibrator/Vibrator.cpp
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2020 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "vibrator@1.3-samsung"
+
+#include "Vibrator.h"
+
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include <hardware/hardware.h>
+#include <hardware/vibrator.h>
+
+#include <cinttypes>
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_3 {
+namespace implementation {
+
+/*
+ * Write value to path and close file.
+ */
+template <typename T>
+static Return<Status> writeNode(const std::string& path, const T& value) {
+    std::ofstream node(path);
+    if (!node) {
+        LOG(ERROR) << "Failed to open: " << path;
+        return Status::UNKNOWN_ERROR;
+    }
+
+    LOG(DEBUG) << "writeNode node: " << path << " value: " << value;
+
+    node << value << std::endl;
+    if (!node) {
+        LOG(ERROR) << "Failed to write: " << value;
+        return Status::UNKNOWN_ERROR;
+    }
+
+    return Status::OK;
+}
+
+static bool nodeExists(const std::string& path) {
+    std::ofstream f(path.c_str());
+    return f.good();
+}
+
+Vibrator::Vibrator() {
+    bool ok;
+
+    ok = nodeExists(VIBRATOR_TIMEOUT_PATH);
+    if (ok) {
+        mIsTimedOutVibriator = true;
+    }
+
+    ok = nodeExists(VIBRATOR_INTENSITY_PATH);
+    if (ok) {
+        mhasTimedOutIntensity = true;
+    }
+}
+
+// Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
+
+Return<Status> Vibrator::on(uint32_t timeoutMs) {
+    return activate(timeoutMs);
+}
+
+Return<Status> Vibrator::off() {
+    return activate(0);
+}
+
+Return<bool> Vibrator::supportsAmplitudeControl() {
+    return true;
+}
+
+Return<Status> Vibrator::setAmplitude(uint8_t amplitude) {
+    uint32_t intensity;
+
+    if (amplitude == 0) {
+        return Status::BAD_VALUE;
+    }
+
+    LOG(DEBUG) << "setting amplitude: " << (uint32_t)amplitude;
+
+    intensity = std::lround((amplitude - 1) * 10000.0 / 254.0);
+    if (intensity > INTENSITY_MAX) {
+        intensity = INTENSITY_MAX;
+    }
+    LOG(DEBUG) << "setting intensity: " << intensity;
+
+    if (mhasTimedOutIntensity) {
+        return writeNode(VIBRATOR_INTENSITY_PATH, intensity);
+    }
+
+    return Status::OK;
+}
+
+Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _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<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<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+// Methods from ::android::hardware::vibrator::V1_3::IVibrator follow.
+
+Return<bool> Vibrator::supportsExternalControl() {
+    return true;
+}
+
+Return<Status> Vibrator::setExternalControl(bool enabled) {
+    if (mEnabled) {
+        LOG(WARNING) << "Setting external control while the vibrator is enabled is "
+                        "unsupported!";
+        return Status::UNSUPPORTED_OPERATION;
+    }
+
+    LOG(INFO) << "ExternalControl: " << mExternalControl << " -> " << enabled;
+    mExternalControl = enabled;
+    return Status::OK;
+}
+
+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) {
+    Status status = Status::OK;
+    uint8_t amplitude;
+    uint32_t ms;
+
+    LOG(DEBUG) << "perform effect: " << toString(effect)
+               << ", strength: " << toString(strength);
+
+    amplitude = strengthToAmplitude(strength, &status);
+    if (status != Status::OK) {
+        _hidl_cb(status, 0);
+        return Void();
+    }
+    setAmplitude(amplitude);
+
+    ms = effectToMs(effect, &status);
+    if (status != Status::OK) {
+        _hidl_cb(status, 0);
+        return Void();
+    }
+    status = activate(ms);
+
+    _hidl_cb(status, ms);
+
+    return Void();
+}
+
+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::activate(uint32_t timeoutMs) {
+    std::lock_guard<std::mutex> lock{mMutex};
+    if (!mIsTimedOutVibriator) {
+        return Status::UNSUPPORTED_OPERATION;
+    }
+
+    return writeNode(VIBRATOR_TIMEOUT_PATH, timeoutMs);
+}
+
+uint8_t Vibrator::strengthToAmplitude(EffectStrength strength, Status* status) {
+    *status = Status::OK;
+
+    switch (strength) {
+        case EffectStrength::LIGHT:
+            return 78;
+        case EffectStrength::MEDIUM:
+            return 128;
+        case EffectStrength::STRONG:
+            return 204;
+    }
+
+    *status = Status::UNSUPPORTED_OPERATION;
+    return 0;
+}
+
+uint32_t Vibrator::effectToMs(Effect effect, Status* status) {
+    *status = Status::OK;
+
+    switch (effect) {
+        case Effect::CLICK:
+            return 20;
+        case Effect::DOUBLE_CLICK:
+            return 25;
+        case Effect::HEAVY_CLICK:
+            return 30;
+        case Effect::TICK:
+        case Effect::TEXTURE_TICK:
+        case Effect::THUD:
+        case Effect::POP:
+            return 15;
+        case Effect::RINGTONE_1:
+        case Effect::RINGTONE_2:
+        case Effect::RINGTONE_3:
+        case Effect::RINGTONE_4:
+        case Effect::RINGTONE_5:
+        case Effect::RINGTONE_6:
+        case Effect::RINGTONE_7:
+        case Effect::RINGTONE_8:
+        case Effect::RINGTONE_9:
+        case Effect::RINGTONE_10:
+        case Effect::RINGTONE_11:
+        case Effect::RINGTONE_12:
+        case Effect::RINGTONE_13:
+        case Effect::RINGTONE_14:
+        case Effect::RINGTONE_15:
+            return 300;
+    }
+
+    *status = Status::UNSUPPORTED_OPERATION;
+    return 0;
+}
+
+}  // namespace implementation
+}  // namespace V1_3
+}  // namespace vibrator
+}  // namespace hardware
+}  // namespace android
diff --git a/hidl/vibrator/Vibrator.h b/hidl/vibrator/Vibrator.h
new file mode 100644
index 0000000..aba75f5
--- /dev/null
+++ b/hidl/vibrator/Vibrator.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2020 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+#define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+
+#include <android/hardware/vibrator/1.3/IVibrator.h>
+#include <hidl/Status.h>
+
+#include <fstream>
+
+#define INTENSITY_MIN 1000
+#define INTENSITY_MAX 10000
+#define INENSITY_DEFAULT INTENSITY_MAX
+
+#define CLICK_TIMING_MS 20
+
+#define VIBRATOR_TIMEOUT_PATH "/sys/class/timed_output/vibrator/enable"
+#define VIBRATOR_INTENSITY_PATH "/sys/class/timed_output/vibrator/intensity"
+
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_3 {
+namespace implementation {
+
+using android::hardware::vibrator::V1_0::EffectStrength;
+using android::hardware::vibrator::V1_0::Status;
+
+class Vibrator : public IVibrator {
+  public:
+    Vibrator();
+
+    // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
+    Return<Status> on(uint32_t timeoutMs) override;
+    Return<Status> off() override;
+    Return<bool> supportsAmplitudeControl() override;
+    Return<Status> setAmplitude(uint8_t amplitude) override;
+    Return<void> perform(V1_0::Effect effect, EffectStrength strength,
+                         perform_cb _hidl_cb) override;
+
+    // Methods from ::android::hardware::vibrator::V1_1::IVibrator follow.
+    Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
+                             perform_cb _hidl_cb) override;
+
+    // Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
+    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:
+    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);
+
+    static uint32_t effectToMs(Effect effect, Status* status);
+    static uint8_t strengthToAmplitude(EffectStrength strength, Status* status);
+
+    bool mEnabled{false};
+    uint8_t mAmplitude{UINT8_MAX};
+    bool mExternalControl{false};
+    std::mutex mMutex;
+    timer_t mTimer{nullptr};
+
+    bool mIsTimedOutVibriator;
+    bool mhasTimedOutIntensity;
+};
+
+}  // namespace implementation
+}  // namespace V1_3
+}  // namespace vibrator
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
diff --git a/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.rc b/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.rc
new file mode 100644
index 0000000..9281acb
--- /dev/null
+++ b/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.rc
@@ -0,0 +1,4 @@
+service vendor.vibrator-1-3 /vendor/bin/hw/android.hardware.vibrator@1.3-service.samsung
+    class hal
+    user system
+    group system
diff --git a/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.xml b/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.xml
new file mode 100644
index 0000000..172aa21
--- /dev/null
+++ b/hidl/vibrator/android.hardware.vibrator@1.3-service.samsung.xml
@@ -0,0 +1,11 @@
+<manifest version="1.0" type="device">
+    <hal format="hidl">
+        <name>android.hardware.vibrator</name>
+        <transport>hwbinder</transport>
+        <version>1.3</version>
+        <interface>
+            <name>IVibrator</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
diff --git a/hidl/vibrator/service.cpp b/hidl/vibrator/service.cpp
new file mode 100644
index 0000000..bfa98b3
--- /dev/null
+++ b/hidl/vibrator/service.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2020 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "vibrator@1.3-samsung"
+
+#include <android-base/logging.h>
+#include <android/hardware/vibrator/1.3/IVibrator.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+#include <utils/Errors.h>
+#include <utils/StrongPointer.h>
+
+#include "Vibrator.h"
+
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::hardware::vibrator::V1_3::IVibrator;
+using android::hardware::vibrator::V1_3::implementation::Vibrator;
+
+using android::OK;
+using android::sp;
+using android::status_t;
+
+int main() {
+    status_t status;
+    sp<IVibrator> vibrator;
+
+    LOG(INFO) << "Vibrator HAL service is starting.";
+
+    vibrator = new Vibrator();
+    if (vibrator == nullptr) {
+        LOG(ERROR) << "Can not create an instance of Vibrator HAL IVibrator, "
+                      "exiting.";
+        goto shutdown;
+    }
+
+    configureRpcThreadpool(1, true);
+
+    status = vibrator->registerAsService();
+    if (status != OK) {
+        LOG(ERROR) << "Could not register service for Vibrator HAL";
+        goto shutdown;
+    }
+
+    LOG(INFO) << "Vibrator HAL service is Ready.";
+    joinRpcThreadpool();
+
+shutdown:
+    // In normal operation, we don't expect the thread pool to shutdown
+    LOG(ERROR) << "Vibrator HAL failed to join thread pool.";
+    return 1;
+}
