diff --git a/vehicle/2.0/default/Android.mk b/vehicle/2.0/default/Android.mk
new file mode 100644
index 0000000..a30d753
--- /dev/null
+++ b/vehicle/2.0/default/Android.mk
@@ -0,0 +1,48 @@
+# Copyright (C) 2016 The Android Open Source 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.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vehicle@2.0-impl
+# TODO(pavelm): add LOCAL_INIT_RC
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+    Vehicle.cpp \
+    VehicleCallback.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+    libhidl \
+    libhwbinder \
+    libutils \
+    android.hardware.vehicle@2.0 \
+
+include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.vehicle@2.0-service
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_SRC_FILES := \
+    VehicleService.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+    liblog \
+    libbinder \
+    libhidl \
+    libhwbinder \
+    libutils \
+    android.hardware.vehicle@2.0
+
+include $(BUILD_EXECUTABLE)
diff --git a/vehicle/2.0/default/Vehicle.cpp b/vehicle/2.0/default/Vehicle.cpp
new file mode 100644
index 0000000..a4933df
--- /dev/null
+++ b/vehicle/2.0/default/Vehicle.cpp
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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.
+ */
+
+#include "Vehicle.h"
+#include "VehicleUtils.h"
+
+#include <utils/SystemClock.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+namespace implementation {
+
+const VehiclePropConfig kVehicleProperties[] = {
+    {
+        .prop = VehicleProperty::INFO_MAKE,
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::STATIC,
+        .permissionModel = VehiclePermissionModel::OEM_ONLY,
+        .configString = init_hidl_string("Some=configuration,options=if,you=have,any=?"),
+    },
+
+    {
+        .prop = VehicleProperty::HVAC_FAN_SPEED,
+        .access = VehiclePropertyAccess::READ_WRITE,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+        .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+        .supportedAreas = static_cast<int32_t>(
+               VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
+        .areaConfigs = init_hidl_vec({
+                VehicleAreaConfig {
+                    .areaId = enum_val(VehicleAreaZone::ROW_2_LEFT),
+                    .minInt32Value = 1,
+                    .maxInt32Value = 7},
+                VehicleAreaConfig {
+                    .areaId = enum_val(VehicleAreaZone::ROW_1_RIGHT),
+                    .minInt32Value = 1,
+                    .maxInt32Value = 5,
+                }
+        }),
+    },
+
+    {
+        .prop = VehicleProperty::INFO_FUEL_CAPACITY,
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+        .permissionModel = VehiclePermissionModel::OEM_ONLY,
+        .areaConfigs = init_hidl_vec({
+                VehicleAreaConfig {
+                    .minFloatValue = 0,
+                    .maxFloatValue = 1.0
+                }
+        })
+    }
+};
+
+const char kInfoMake[] = "Android Super Car";
+
+
+Return<void> Vehicle::getAllPropConfigs(getAllPropConfigs_cb _hidl_cb)  {
+    hidl_vec<VehiclePropConfig> configs;
+
+    configs.setToExternal(const_cast<VehiclePropConfig*>(kVehicleProperties),
+                          arraysize(kVehicleProperties));
+
+    _hidl_cb(configs);
+    return Void();
+}
+
+Return<void> Vehicle::getPropConfigs(const hidl_vec<VehicleProperty>& properties,
+                                     getAllPropConfigs_cb _hidl_cb)  {
+    // TODO(pavelm): add default implementation
+    hidl_vec<VehiclePropConfig> configs;
+    _hidl_cb(configs);
+    return Void();
+}
+
+Return<void> Vehicle::get(VehicleProperty propId, int32_t areaId, get_cb _hidl_cb)  {
+    VehiclePropValue v {
+        .prop = propId,
+        .areaId = areaId,
+        .timestamp = elapsedRealtimeNano(),
+    };
+
+    StatusCode status = StatusCode::OK;
+
+    if (propId == VehicleProperty::INFO_MAKE) {
+        v.value.stringValue.setToExternal(kInfoMake, strlen(kInfoMake));
+    } else if (propId == VehicleProperty::HVAC_FAN_SPEED) {
+        v.value.int32Values = init_hidl_vec({42});
+    } else {
+        status = StatusCode::INVALID_ARG;
+    }
+
+    _hidl_cb(status, v);
+
+    return Void();
+}
+
+Return<StatusCode> Vehicle::set(const VehiclePropValue& value)  {
+    // TODO(pavelm): add default implementation
+    return StatusCode::OK;
+}
+
+Return<StatusCode> Vehicle::subscribe(const sp<IVehicleCallback>& listener,
+                                   const hidl_vec<SubscribeOptions>& options)  {
+    // TODO(pavelm): add default implementation
+    return StatusCode::OK;
+}
+
+Return<StatusCode> Vehicle::unsubscribe(VehicleProperty propId)  {
+    // TODO(pavelm): add default implementation
+    return StatusCode::OK;
+}
+
+Return<void> Vehicle::debugDump(debugDump_cb _hidl_cb) {
+    hidl_string debug;
+    debug = "Put debug data here";
+
+    _hidl_cb(debug);
+
+    return Void();
+}
+
+IVehicle* HIDL_FETCH_IVehicle(const char* /* name */) {
+    return new Vehicle();
+}
+
+} // namespace implementation
+}  // namespace V2_0
+}  // namespace vehicle
+}  // namespace hardware
+}  // namespace android
diff --git a/vehicle/2.0/default/Vehicle.h b/vehicle/2.0/default/Vehicle.h
new file mode 100644
index 0000000..c0fe03e
--- /dev/null
+++ b/vehicle/2.0/default/Vehicle.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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 HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
+#define HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+namespace implementation {
+
+using ::android::hardware::vehicle::V2_0::IVehicle;
+using ::android::hardware::vehicle::V2_0::IVehicleCallback;
+using ::android::hardware::vehicle::V2_0::SubscribeOptions;
+using ::android::hardware::vehicle::V2_0::VehiclePropConfig;
+using ::android::hardware::vehicle::V2_0::VehiclePropValue;
+using ::android::hardware::vehicle::V2_0::VehicleProperty;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Vehicle : public IVehicle {
+    // Methods from ::android::hardware::vehicle::V2_0::IVehicle follow.
+    Return<void> getAllPropConfigs(getAllPropConfigs_cb _hidl_cb)  override;
+    Return<void> getPropConfigs(const hidl_vec<VehicleProperty>& properties, getPropConfigs_cb _hidl_cb)  override;
+    Return<void> get(VehicleProperty propId, int32_t areaId, get_cb _hidl_cb)  override;
+    Return<StatusCode> set(const VehiclePropValue& value)  override;
+    Return<StatusCode> subscribe(const sp<IVehicleCallback>& listener, const hidl_vec<SubscribeOptions>& options)  override;
+    Return<StatusCode> unsubscribe(VehicleProperty propId)  override;
+    Return<void> debugDump(debugDump_cb _hidl_cb = nullptr) override;
+};
+
+extern "C" IVehicle* HIDL_FETCH_IVehicle(const char* name);
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace vehicle
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HIDL_GENERATED_android_hardware_vehicle_V2_0_Vehicle_H_
diff --git a/vehicle/2.0/default/VehicleCallback.cpp b/vehicle/2.0/default/VehicleCallback.cpp
new file mode 100644
index 0000000..985b7dc
--- /dev/null
+++ b/vehicle/2.0/default/VehicleCallback.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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.
+ */
+
+#include "VehicleCallback.h"
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::vehicle::V2_0::IVehicleCallback follow.
+Return<void> VehicleCallback::onPropertyEvent(const hidl_vec<VehiclePropValue>& value)  {
+    // TODO(pavelm): add default implementation
+    return Void();
+}
+
+// Methods from ::android::hardware::vehicle::V2_0::IVehicleCallback follow.
+Return<void> VehicleCallback::onPropertySet(const VehiclePropValue& value)  {
+    // TODO(pavelm): add default implementation
+    return Void();
+}
+
+Return<void> VehicleCallback::onError(StatusCode errorCode,
+                                      VehicleProperty propId,
+                                      VehiclePropertyOperation operation)  {
+    // TODO(pavelm): add default implementation
+    return Void();
+}
+
+
+IVehicleCallback* HIDL_FETCH_IVehicleCallback(const char* /* name */) {
+    return new VehicleCallback();
+}
+
+} // namespace implementation
+}  // namespace V2_0
+}  // namespace vehicle
+}  // namespace hardware
+}  // namespace android
diff --git a/vehicle/2.0/default/VehicleCallback.h b/vehicle/2.0/default/VehicleCallback.h
new file mode 100644
index 0000000..d037c94
--- /dev/null
+++ b/vehicle/2.0/default/VehicleCallback.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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 HIDL_GENERATED_android_hardware_vehicle_V2_0_VehicleCallback_H_
+#define HIDL_GENERATED_android_hardware_vehicle_V2_0_VehicleCallback_H_
+
+#include <android/hardware/vehicle/2.0/IVehicleCallback.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+namespace implementation {
+
+using ::android::hardware::vehicle::V2_0::IVehicleCallback;
+using ::android::hardware::vehicle::V2_0::VehiclePropValue;
+using ::android::hardware::vehicle::V2_0::VehicleProperty;
+using ::android::hardware::vehicle::V2_0::VehiclePropertyOperation;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct VehicleCallback : public IVehicleCallback {
+    // Methods from ::android::hardware::vehicle::V2_0::IVehicleCallback follow.
+    Return<void> onPropertyEvent(const hidl_vec<VehiclePropValue>& values)  override;
+    Return<void> onPropertySet(const VehiclePropValue& value)  override;
+    Return<void> onError(StatusCode errorCode, VehicleProperty propId, VehiclePropertyOperation operation)  override;
+
+};
+
+extern "C" IVehicleCallback* HIDL_FETCH_IVehicleCallback(const char* name);
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace vehicle
+}  // namespace hardware
+}  // namespace android
+
+#endif  // HIDL_GENERATED_android_hardware_vehicle_V2_0_VehicleCallback_H_
diff --git a/vehicle/2.0/default/VehicleService.cpp b/vehicle/2.0/default/VehicleService.cpp
new file mode 100644
index 0000000..b685977
--- /dev/null
+++ b/vehicle/2.0/default/VehicleService.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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 "android.hardware.vehicle@2.0-service"
+#include <utils/Log.h>
+
+#include <iostream>
+
+#include <hwbinder/IPCThreadState.h>
+
+#include <android/hardware/vehicle/2.0/IVehicle.h>
+
+using namespace android;
+using namespace android::hardware;
+using namespace android::hardware::vehicle::V2_0;
+
+int main(int /* argc */, char* /* argv */ []) {
+    ALOGI("Service is starting");
+    android::sp<IVehicle> service = IVehicle::getService("Vehicle");
+    if (service.get() == NULL) {
+        ALOGE("IVehicle::getService returned NULL, exiting");
+        return 1;
+    }
+
+    ALOGI("Registering as service");
+    // will register the -impl as a binderized service in this process
+    service->registerAsService("Vehicle");
+
+    ALOGI("Ready");
+    ProcessState::self()->setThreadPoolMaxThreadCount(0);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+}
diff --git a/vehicle/2.0/default/VehicleUtils.h b/vehicle/2.0/default/VehicleUtils.h
new file mode 100644
index 0000000..78e34e5
--- /dev/null
+++ b/vehicle/2.0/default/VehicleUtils.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2016 The Android Open Source 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_vehicle_V2_0_VehicleUtils_H_
+#define android_hardware_vehicle_V2_0_VehicleUtils_H_
+
+#include <hidl/HidlSupport.h>
+#include <android/hardware/vehicle/2.0/types.h>
+
+namespace android {
+namespace hardware {
+namespace vehicle {
+namespace V2_0 {
+
+hidl_string init_hidl_string(const char *cstr) {
+    hidl_string hidlString;
+    hidlString = cstr;
+    return hidlString;
+}
+
+template <typename T>
+hidl_vec<T> init_hidl_vec(std::initializer_list<T> values) {
+    hidl_vec<T> vector;
+    vector.resize(values.size());
+    size_t i = 0;
+    for (auto& c : values) {
+        vector[i++] = c;
+    }
+    return vector;
+}
+
+// OR operator for class enums. The return type will be enum's underline type.
+template <typename ENUM>
+typename std::underlying_type<ENUM>::type operator |(ENUM v1, ENUM v2) {
+    return static_cast<typename std::underlying_type<ENUM>::type>(v1)
+           | static_cast<typename std::underlying_type<ENUM>::type>(v2);
+}
+
+// AND operator for class enums. The return type will be enum's underline type.
+template <typename ENUM>
+typename std::underlying_type<ENUM>::type operator &(ENUM v1, ENUM v2) {
+    return static_cast<typename std::underlying_type<ENUM>::type>(v1)
+           | static_cast<typename std::underlying_type<ENUM>::type>(v2);
+}
+
+// Returns underlying (integer) value for given enum.
+template <typename ENUM>
+typename std::underlying_type<ENUM>::type enum_val(ENUM const value)
+{
+    return static_cast<typename std::underlying_type<ENUM>::type>(value);
+}
+
+VehiclePropertyType getPropType(VehicleProperty prop) {
+    return static_cast<VehiclePropertyType>(
+        static_cast<int32_t>(prop) & static_cast<int32_t>(VehiclePropertyType::MASK));
+}
+
+VehiclePropertyGroup getPropGroup(VehicleProperty prop) {
+    return static_cast<VehiclePropertyGroup>(
+        static_cast<int32_t>(prop) & static_cast<int32_t>(VehiclePropertyGroup::MASK));
+}
+
+bool checkPropType(VehicleProperty prop, VehiclePropertyType type) {
+    return getPropType(prop) == type;
+}
+
+bool isSystemProperty(VehicleProperty prop) {
+    return VehiclePropertyGroup::SYSTEM == getPropGroup(prop);
+}
+
+
+}  // namespace V2_0
+}  // namespace vehicle
+}  // namespace hardware
+}  // namespace android
+
+#endif android_hardware_vehicle_V2_0_VehicleUtils_H_
