summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--automotive/Android.bp1
-rw-r--r--automotive/vehicle/2.0/default/Android.mk68
-rw-r--r--automotive/vehicle/2.0/default/VehicleService.cpp5
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/AccessControlConfigParser.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/ConcurrentQueue.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h)2
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/SubscriptionManager.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHal.h (renamed from automotive/vehicle/2.0/default/VehicleHal.h)3
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropConfigIndex.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleUtils.h (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h)0
-rw-r--r--automotive/vehicle/2.0/default/common/src/AccessControlConfigParser.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp)2
-rw-r--r--automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp (renamed from automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h (renamed from automotive/vehicle/2.0/default/impl/DefaultConfig.h)2
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp (renamed from automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp)0
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h (renamed from automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h)11
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto (renamed from automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto)0
-rw-r--r--automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp4
-rw-r--r--automotive/vehicle/2.0/default/tests/Obd2SensorStore_test.cpp4
-rw-r--r--automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp2
-rw-r--r--automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp2
-rw-r--r--automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h3
-rw-r--r--automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp2
-rw-r--r--automotive/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp2
-rw-r--r--automotive/vehicle/2.0/types.hal22
-rw-r--r--automotive/vehicle/2.1/Android.bp64
-rw-r--r--automotive/vehicle/2.1/Android.mk116
-rw-r--r--automotive/vehicle/2.1/IVehicle.hal31
-rw-r--r--automotive/vehicle/2.1/default/Android.mk84
-rw-r--r--automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc4
-rw-r--r--automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h47
-rw-r--r--automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h93
-rw-r--r--automotive/vehicle/2.1/default/service.cpp97
-rw-r--r--automotive/vehicle/2.1/types.hal46
39 files changed, 646 insertions, 71 deletions
diff --git a/automotive/Android.bp b/automotive/Android.bp
index aa8f74fd..0302cd57 100644
--- a/automotive/Android.bp
+++ b/automotive/Android.bp
@@ -2,4 +2,5 @@
2subdirs = [ 2subdirs = [
3 "vehicle", 3 "vehicle",
4 "vehicle/2.0", 4 "vehicle/2.0",
5 "vehicle/2.1",
5] 6]
diff --git a/automotive/vehicle/2.0/default/Android.mk b/automotive/vehicle/2.0/default/Android.mk
index c394f2ee..324be512 100644
--- a/automotive/vehicle/2.0/default/Android.mk
+++ b/automotive/vehicle/2.0/default/Android.mk
@@ -14,20 +14,26 @@
14 14
15LOCAL_PATH := $(call my-dir) 15LOCAL_PATH := $(call my-dir)
16 16
17module_prefix = android.hardware.automotive.vehicle@2.0 17vhal_v2_0 = android.hardware.automotive.vehicle@2.0
18 18
19############################################################################### 19###############################################################################
20# Vehicle reference implementation lib 20# Vehicle reference implementation lib
21############################################################################### 21###############################################################################
22include $(CLEAR_VARS) 22include $(CLEAR_VARS)
23LOCAL_MODULE := $(module_prefix)-manager-lib 23LOCAL_MODULE := $(vhal_v2_0)-manager-lib
24LOCAL_SRC_FILES := \ 24LOCAL_SRC_FILES := \
25 vehicle_hal_manager/AccessControlConfigParser.cpp \ 25 common/src/AccessControlConfigParser.cpp \
26 vehicle_hal_manager/Obd2SensorStore.cpp \ 26 common/src/Obd2SensorStore.cpp \
27 vehicle_hal_manager/SubscriptionManager.cpp \ 27 common/src/SubscriptionManager.cpp \
28 vehicle_hal_manager/VehicleHalManager.cpp \ 28 common/src/VehicleHalManager.cpp \
29 vehicle_hal_manager/VehicleObjectPool.cpp \ 29 common/src/VehicleObjectPool.cpp \
30 vehicle_hal_manager/VehicleUtils.cpp \ 30 common/src/VehicleUtils.cpp \
31
32LOCAL_C_INCLUDES := \
33 $(LOCAL_PATH)/common/include/vhal_v2_0
34
35LOCAL_EXPORT_C_INCLUDE_DIRS := \
36 $(LOCAL_PATH)/common/include
31 37
32LOCAL_SHARED_LIBRARIES := \ 38LOCAL_SHARED_LIBRARIES := \
33 libbinder \ 39 libbinder \
@@ -36,7 +42,7 @@ LOCAL_SHARED_LIBRARIES := \
36 libhwbinder \ 42 libhwbinder \
37 liblog \ 43 liblog \
38 libutils \ 44 libutils \
39 $(module_prefix) \ 45 $(vhal_v2_0) \
40 46
41include $(BUILD_STATIC_LIBRARY) 47include $(BUILD_STATIC_LIBRARY)
42 48
@@ -44,11 +50,11 @@ include $(BUILD_STATIC_LIBRARY)
44# Vehicle HAL Protobuf library 50# Vehicle HAL Protobuf library
45############################################################################### 51###############################################################################
46include $(CLEAR_VARS) 52include $(CLEAR_VARS)
47LOCAL_SRC_FILES := $(call all-proto-files-under, impl/proto) 53LOCAL_SRC_FILES := $(call all-proto-files-under, impl/vhal_v2_0/proto)
48 54
49LOCAL_PROTOC_OPTIMIZE_TYPE := nano 55LOCAL_PROTOC_OPTIMIZE_TYPE := nano
50 56
51LOCAL_MODULE := $(module_prefix)-libproto-native 57LOCAL_MODULE := $(vhal_v2_0)-libproto-native
52LOCAL_MODULE_CLASS := STATIC_LIBRARIES 58LOCAL_MODULE_CLASS := STATIC_LIBRARIES
53 59
54LOCAL_MODULE_TAGS := optional 60LOCAL_MODULE_TAGS := optional
@@ -57,7 +63,7 @@ LOCAL_STRIP_MODULE := keep_symbols
57 63
58generated_sources_dir := $(call local-generated-sources-dir) 64generated_sources_dir := $(call local-generated-sources-dir)
59LOCAL_EXPORT_C_INCLUDE_DIRS := \ 65LOCAL_EXPORT_C_INCLUDE_DIRS := \
60 $(generated_sources_dir)/proto/$(LOCAL_PATH)/impl/proto 66 $(generated_sources_dir)/proto/$(LOCAL_PATH)/impl/vhal_v2_0/proto
61 67
62include $(BUILD_STATIC_LIBRARY) 68include $(BUILD_STATIC_LIBRARY)
63 69
@@ -67,9 +73,18 @@ include $(BUILD_STATIC_LIBRARY)
67############################################################################### 73###############################################################################
68include $(CLEAR_VARS) 74include $(CLEAR_VARS)
69 75
70LOCAL_MODULE:= $(module_prefix)-default-impl-lib 76LOCAL_MODULE:= $(vhal_v2_0)-default-impl-lib
71LOCAL_SRC_FILES:= \ 77LOCAL_SRC_FILES:= \
72 impl/DefaultVehicleHal.cpp \ 78 impl/vhal_v2_0/DefaultVehicleHal.cpp \
79
80LOCAL_C_INCLUDES := \
81 $(LOCAL_PATH)/impl/vhal_v2_0
82
83LOCAL_EXPORT_C_INCLUDE_DIRS := \
84 $(LOCAL_PATH)/impl
85
86LOCAL_WHOLE_STATIC_LIBRARIES := \
87 $(vhal_v2_0)-manager-lib \
73 88
74LOCAL_SHARED_LIBRARIES := \ 89LOCAL_SHARED_LIBRARIES := \
75 libbinder \ 90 libbinder \
@@ -79,10 +94,10 @@ LOCAL_SHARED_LIBRARIES := \
79 liblog \ 94 liblog \
80 libprotobuf-cpp-lite \ 95 libprotobuf-cpp-lite \
81 libutils \ 96 libutils \
82 $(module_prefix) \ 97 $(vhal_v2_0) \
83 98
84LOCAL_STATIC_LIBRARIES := \ 99LOCAL_STATIC_LIBRARIES := \
85 $(module_prefix)-libproto-native 100 $(vhal_v2_0)-libproto-native \
86 101
87include $(BUILD_STATIC_LIBRARY) 102include $(BUILD_STATIC_LIBRARY)
88 103
@@ -92,9 +107,10 @@ include $(BUILD_STATIC_LIBRARY)
92############################################################################### 107###############################################################################
93include $(CLEAR_VARS) 108include $(CLEAR_VARS)
94 109
95LOCAL_MODULE:= $(module_prefix)-manager-unit-tests 110LOCAL_MODULE:= $(vhal_v2_0)-manager-unit-tests
96 111
97LOCAL_WHOLE_STATIC_LIBRARIES := $(module_prefix)-manager-lib 112LOCAL_WHOLE_STATIC_LIBRARIES := \
113 $(vhal_v2_0)-manager-lib \
98 114
99LOCAL_SRC_FILES:= \ 115LOCAL_SRC_FILES:= \
100 tests/AccessControlConfigParser_test.cpp \ 116 tests/AccessControlConfigParser_test.cpp \
@@ -111,7 +127,7 @@ LOCAL_SHARED_LIBRARIES := \
111 libhwbinder \ 127 libhwbinder \
112 liblog \ 128 liblog \
113 libutils \ 129 libutils \
114 $(module_prefix) \ 130 $(vhal_v2_0) \
115 131
116LOCAL_CFLAGS += -Wall -Wextra 132LOCAL_CFLAGS += -Wall -Wextra
117LOCAL_MODULE_TAGS := tests 133LOCAL_MODULE_TAGS := tests
@@ -123,18 +139,14 @@ include $(BUILD_NATIVE_TEST)
123# Vehicle HAL service 139# Vehicle HAL service
124############################################################################### 140###############################################################################
125include $(CLEAR_VARS) 141include $(CLEAR_VARS)
126LOCAL_MODULE := $(module_prefix)-service 142LOCAL_MODULE := $(vhal_v2_0)-service
127LOCAL_INIT_RC := $(module_prefix)-service.rc 143LOCAL_INIT_RC := $(vhal_v2_0)-service.rc
128LOCAL_PROPRIETARY_MODULE := true 144LOCAL_PROPRIETARY_MODULE := true
129LOCAL_MODULE_RELATIVE_PATH := hw 145LOCAL_MODULE_RELATIVE_PATH := hw
130 146
131LOCAL_SRC_FILES := \ 147LOCAL_SRC_FILES := \
132 VehicleService.cpp 148 VehicleService.cpp
133 149
134LOCAL_WHOLE_STATIC_LIBRARIES := \
135 $(module_prefix)-manager-lib \
136 $(module_prefix)-default-impl-lib \
137
138LOCAL_SHARED_LIBRARIES := \ 150LOCAL_SHARED_LIBRARIES := \
139 libbinder \ 151 libbinder \
140 libhidlbase \ 152 libhidlbase \
@@ -143,9 +155,11 @@ LOCAL_SHARED_LIBRARIES := \
143 liblog \ 155 liblog \
144 libprotobuf-cpp-lite \ 156 libprotobuf-cpp-lite \
145 libutils \ 157 libutils \
146 $(module_prefix) \ 158 $(vhal_v2_0) \
147 159
148LOCAL_STATIC_LIBRARIES := \ 160LOCAL_STATIC_LIBRARIES := \
149 $(module_prefix)-libproto-native 161 $(vhal_v2_0)-manager-lib \
162 $(vhal_v2_0)-default-impl-lib \
163 $(vhal_v2_0)-libproto-native \
150 164
151include $(BUILD_EXECUTABLE) 165include $(BUILD_EXECUTABLE)
diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp
index 345dbccb..f88ce7b0 100644
--- a/automotive/vehicle/2.0/default/VehicleService.cpp
+++ b/automotive/vehicle/2.0/default/VehicleService.cpp
@@ -20,9 +20,8 @@
20 20
21#include <iostream> 21#include <iostream>
22 22
23 23#include <vhal_v2_0/VehicleHalManager.h>
24#include <vehicle_hal_manager/VehicleHalManager.h> 24#include <vhal_v2_0/DefaultVehicleHal.h>
25#include <impl/DefaultVehicleHal.h>
26 25
27using namespace android; 26using namespace android;
28using namespace android::hardware; 27using namespace android::hardware;
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/AccessControlConfigParser.h
index 8ef6f5aa..8ef6f5aa 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/AccessControlConfigParser.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/ConcurrentQueue.h
index b63429fa..b63429fa 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/ConcurrentQueue.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/ConcurrentQueue.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h
index 3e2a08ea..fe231bee 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h
@@ -19,7 +19,7 @@
19 19
20#include <vector> 20#include <vector>
21 21
22#include <VehicleHal.h> 22#include "VehicleHal.h"
23 23
24namespace android { 24namespace android {
25namespace hardware { 25namespace hardware {
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/SubscriptionManager.h
index 6a12b771..6a12b771 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/SubscriptionManager.h
diff --git a/automotive/vehicle/2.0/default/VehicleHal.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHal.h
index 76df5b81..8203a1e6 100644
--- a/automotive/vehicle/2.0/default/VehicleHal.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHal.h
@@ -18,8 +18,7 @@
18#define android_hardware_automotive_vehicle_V2_0_VehicleHal_H 18#define android_hardware_automotive_vehicle_V2_0_VehicleHal_H
19 19
20#include <android/hardware/automotive/vehicle/2.0/IVehicle.h> 20#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
21#include "vehicle_hal_manager/VehicleObjectPool.h" 21#include "VehicleObjectPool.h"
22
23 22
24namespace android { 23namespace android {
25namespace hardware { 24namespace hardware {
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h
index 4bff4d15..4bff4d15 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h
index 05c649be..05c649be 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropConfigIndex.h
index 0528f687..0528f687 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehiclePropConfigIndex.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropConfigIndex.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleUtils.h
index ce0b163c..ce0b163c 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleUtils.h
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp b/automotive/vehicle/2.0/default/common/src/AccessControlConfigParser.cpp
index 6a3f8e55..6a3f8e55 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/AccessControlConfigParser.cpp
+++ b/automotive/vehicle/2.0/default/common/src/AccessControlConfigParser.cpp
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp b/automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp
index 761e550a..4ee0a715 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
+++ b/automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp
@@ -17,7 +17,7 @@
17#include "Obd2SensorStore.h" 17#include "Obd2SensorStore.h"
18 18
19#include <utils/SystemClock.h> 19#include <utils/SystemClock.h>
20#include <vehicle_hal_manager/VehicleUtils.h> 20#include "VehicleUtils.h"
21 21
22namespace android { 22namespace android {
23namespace hardware { 23namespace hardware {
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp
index f6f2758f..f6f2758f 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/SubscriptionManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
index 3a5e5044..3a5e5044 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleHalManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp b/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp
index ac1245a0..ac1245a0 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp
index 311cdef1..311cdef1 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleUtils.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp
diff --git a/automotive/vehicle/2.0/default/impl/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 0c549b94..ec08a43e 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -18,7 +18,7 @@
18#define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ 18#define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
19 19
20#include <android/hardware/automotive/vehicle/2.0/IVehicle.h> 20#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
21#include <vehicle_hal_manager/VehicleUtils.h> 21#include <vhal_v2_0/VehicleUtils.h>
22 22
23namespace android { 23namespace android {
24namespace hardware { 24namespace hardware {
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
index d3d77b66..d3d77b66 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h
index 4b89f554..51f7ba35 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h
@@ -18,15 +18,16 @@
18#define android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleHal_H_ 18#define android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleHal_H_
19 19
20#include <memory> 20#include <memory>
21
22#include <VehicleHal.h>
23#include <impl/DefaultConfig.h>
24#include <sys/socket.h> 21#include <sys/socket.h>
25#include <thread> 22#include <thread>
23
26#include <utils/SystemClock.h> 24#include <utils/SystemClock.h>
27#include <vehicle_hal_manager/Obd2SensorStore.h>
28#include "VehicleHalProto.pb.h"
29 25
26#include <vhal_v2_0/VehicleHal.h>
27#include <vhal_v2_0/Obd2SensorStore.h>
28
29#include "DefaultConfig.h"
30#include "VehicleHalProto.pb.h"
30 31
31namespace android { 32namespace android {
32namespace hardware { 33namespace hardware {
diff --git a/automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto
index 86433f50..86433f50 100644
--- a/automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto
diff --git a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
index 6922b860..d9611c03 100644
--- a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
@@ -19,8 +19,8 @@
19#include <fstream> 19#include <fstream>
20#include <unordered_set> 20#include <unordered_set>
21 21
22#include "vehicle_hal_manager/AccessControlConfigParser.h" 22#include "vhal_v2_0/AccessControlConfigParser.h"
23#include <vehicle_hal_manager/VehicleUtils.h> 23#include "vhal_v2_0/VehicleUtils.h"
24 24
25namespace android { 25namespace android {
26namespace hardware { 26namespace hardware {
diff --git a/automotive/vehicle/2.0/default/tests/Obd2SensorStore_test.cpp b/automotive/vehicle/2.0/default/tests/Obd2SensorStore_test.cpp
index 3ebebbd0..a01c0f49 100644
--- a/automotive/vehicle/2.0/default/tests/Obd2SensorStore_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/Obd2SensorStore_test.cpp
@@ -16,8 +16,8 @@
16 16
17 #include <gtest/gtest.h> 17 #include <gtest/gtest.h>
18 18
19#include "vehicle_hal_manager/Obd2SensorStore.h" 19#include "vhal_v2_0/Obd2SensorStore.h"
20#include "vehicle_hal_manager/VehicleUtils.h" 20#include "vhal_v2_0/VehicleUtils.h"
21 21
22namespace android { 22namespace android {
23namespace hardware { 23namespace hardware {
diff --git a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
index c6c6add3..e13d0036 100644
--- a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
@@ -19,7 +19,7 @@
19 19
20#include <gtest/gtest.h> 20#include <gtest/gtest.h>
21 21
22#include "vehicle_hal_manager/SubscriptionManager.h" 22#include "vhal_v2_0/SubscriptionManager.h"
23 23
24#include "VehicleHalTestUtils.h" 24#include "VehicleHalTestUtils.h"
25 25
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
index 274a8432..f6373445 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -21,7 +21,7 @@
21 21
22#include <gtest/gtest.h> 22#include <gtest/gtest.h>
23 23
24#include "vehicle_hal_manager/VehicleHalManager.h" 24#include "vhal_v2_0/VehicleHalManager.h"
25 25
26#include "VehicleHalTestUtils.h" 26#include "VehicleHalTestUtils.h"
27 27
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index 8ba36d82..ce1ed7d9 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -18,10 +18,11 @@
18#define android_hardware_automotive_vehicle_V2_0_VehicleDebugUtils_H_ 18#define android_hardware_automotive_vehicle_V2_0_VehicleDebugUtils_H_
19 19
20#include <android/hardware/automotive/vehicle/2.0/types.h> 20#include <android/hardware/automotive/vehicle/2.0/types.h>
21#include <vehicle_hal_manager/VehicleUtils.h>
22#include <ios> 21#include <ios>
23#include <sstream> 22#include <sstream>
24 23
24#include "vhal_v2_0/VehicleUtils.h"
25
25namespace android { 26namespace android {
26namespace hardware { 27namespace hardware {
27namespace automotive { 28namespace automotive {
diff --git a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
index 7d373557..a291351f 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
@@ -20,7 +20,7 @@
20 20
21#include <utils/SystemClock.h> 21#include <utils/SystemClock.h>
22 22
23#include "vehicle_hal_manager/VehicleObjectPool.h" 23#include "vhal_v2_0/VehicleObjectPool.h"
24 24
25namespace android { 25namespace android {
26namespace hardware { 26namespace hardware {
diff --git a/automotive/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp b/automotive/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp
index fad4ab38..0f658200 100644
--- a/automotive/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehiclePropConfigIndex_test.cpp
@@ -16,7 +16,7 @@
16 16
17#include <gtest/gtest.h> 17#include <gtest/gtest.h>
18 18
19#include "vehicle_hal_manager/VehiclePropConfigIndex.h" 19#include "vhal_v2_0/VehiclePropConfigIndex.h"
20 20
21#include "VehicleHalTestUtils.h" 21#include "VehicleHalTestUtils.h"
22 22
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 68a8a170..5e22364f 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -226,28 +226,6 @@ enum VehicleProperty: int32_t {
226 | VehicleArea:GLOBAL), 226 | VehicleArea:GLOBAL),
227 227
228 /* 228 /*
229 * Reports wheel rotational distance in meters since last wheel tick
230 * event
231 *
232 * The value is a vector each element represents distance for individual
233 * wheel in the following order: left front, right front, left rear,
234 * right rear. VehiclePropValue.timestamp must be correctly filled in.
235 *
236 * Vendors must specify wheels that support this sensor in
237 * VehiclePropConfig.configFlags. The format of this field is a bitset of
238 * values from Wheel enum.
239 *
240 * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
241 * @access VehiclePropertyAccess:READ
242 * @unit VehicleUnit:METER
243 */
244 WHEEL_TICK = (
245 0x0306
246 | VehiclePropertyGroup:SYSTEM
247 | VehiclePropertyType:FLOAT_VEC
248 | VehicleArea:GLOBAL),
249
250 /*
251 * Currently selected gear 229 * Currently selected gear
252 * 230 *
253 * @change_mode VehiclePropertyChangeMode:ON_CHANGE 231 * @change_mode VehiclePropertyChangeMode:ON_CHANGE
diff --git a/automotive/vehicle/2.1/Android.bp b/automotive/vehicle/2.1/Android.bp
new file mode 100644
index 00000000..12bb4edb
--- /dev/null
+++ b/automotive/vehicle/2.1/Android.bp
@@ -0,0 +1,64 @@
1// This file is autogenerated by hidl-gen. Do not edit manually.
2
3filegroup {
4 name: "android.hardware.automotive.vehicle@2.1_hal",
5 srcs: [
6 "types.hal",
7 "IVehicle.hal",
8 ],
9}
10
11genrule {
12 name: "android.hardware.automotive.vehicle@2.1_genc++",
13 tools: ["hidl-gen"],
14 cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.1",
15 srcs: [
16 "types.hal",
17 "IVehicle.hal",
18 ],
19 out: [
20 "android/hardware/automotive/vehicle/2.1/types.cpp",
21 "android/hardware/automotive/vehicle/2.1/VehicleAll.cpp",
22 ],
23}
24
25genrule {
26 name: "android.hardware.automotive.vehicle@2.1_genc++_headers",
27 tools: ["hidl-gen"],
28 cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.1",
29 srcs: [
30 "types.hal",
31 "IVehicle.hal",
32 ],
33 out: [
34 "android/hardware/automotive/vehicle/2.1/types.h",
35 "android/hardware/automotive/vehicle/2.1/IVehicle.h",
36 "android/hardware/automotive/vehicle/2.1/IHwVehicle.h",
37 "android/hardware/automotive/vehicle/2.1/BnHwVehicle.h",
38 "android/hardware/automotive/vehicle/2.1/BpHwVehicle.h",
39 "android/hardware/automotive/vehicle/2.1/BsVehicle.h",
40 ],
41}
42
43cc_library_shared {
44 name: "android.hardware.automotive.vehicle@2.1",
45 generated_sources: ["android.hardware.automotive.vehicle@2.1_genc++"],
46 generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
47 export_generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
48 shared_libs: [
49 "libhidlbase",
50 "libhidltransport",
51 "libhwbinder",
52 "liblog",
53 "libutils",
54 "libcutils",
55 "android.hardware.automotive.vehicle@2.0",
56 ],
57 export_shared_lib_headers: [
58 "libhidlbase",
59 "libhidltransport",
60 "libhwbinder",
61 "libutils",
62 "android.hardware.automotive.vehicle@2.0",
63 ],
64}
diff --git a/automotive/vehicle/2.1/Android.mk b/automotive/vehicle/2.1/Android.mk
new file mode 100644
index 00000000..f618268f
--- /dev/null
+++ b/automotive/vehicle/2.1/Android.mk
@@ -0,0 +1,116 @@
1# This file is autogenerated by hidl-gen. Do not edit manually.
2
3LOCAL_PATH := $(call my-dir)
4
5################################################################################
6
7include $(CLEAR_VARS)
8LOCAL_MODULE := android.hardware.automotive.vehicle@2.1-java
9LOCAL_MODULE_CLASS := JAVA_LIBRARIES
10
11intermediates := $(local-generated-sources-dir)
12
13HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
14
15LOCAL_JAVA_LIBRARIES := \
16 android.hardware.automotive.vehicle@2.0-java \
17 android.hidl.base@1.0-java \
18
19
20#
21# Build types.hal (VehicleProperty)
22#
23GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VehicleProperty.java
24$(GEN): $(HIDL)
25$(GEN): PRIVATE_HIDL := $(HIDL)
26$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
27$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
28$(GEN): PRIVATE_CUSTOM_TOOL = \
29 $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
30 -Ljava \
31 -randroid.hardware:hardware/interfaces \
32 -randroid.hidl:system/libhidl/transport \
33 android.hardware.automotive.vehicle@2.1::types.VehicleProperty
34
35$(GEN): $(LOCAL_PATH)/types.hal
36 $(transform-generated-source)
37LOCAL_GENERATED_SOURCES += $(GEN)
38
39#
40# Build IVehicle.hal
41#
42GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
43$(GEN): $(HIDL)
44$(GEN): PRIVATE_HIDL := $(HIDL)
45$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVehicle.hal
46$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
47$(GEN): PRIVATE_CUSTOM_TOOL = \
48 $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
49 -Ljava \
50 -randroid.hardware:hardware/interfaces \
51 -randroid.hidl:system/libhidl/transport \
52 android.hardware.automotive.vehicle@2.1::IVehicle
53
54$(GEN): $(LOCAL_PATH)/IVehicle.hal
55 $(transform-generated-source)
56LOCAL_GENERATED_SOURCES += $(GEN)
57include $(BUILD_JAVA_LIBRARY)
58
59
60################################################################################
61
62include $(CLEAR_VARS)
63LOCAL_MODULE := android.hardware.automotive.vehicle@2.1-java-static
64LOCAL_MODULE_CLASS := JAVA_LIBRARIES
65
66intermediates := $(local-generated-sources-dir)
67
68HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
69
70LOCAL_STATIC_JAVA_LIBRARIES := \
71 android.hardware.automotive.vehicle@2.0-java-static \
72 android.hidl.base@1.0-java-static \
73
74
75#
76# Build types.hal (VehicleProperty)
77#
78GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VehicleProperty.java
79$(GEN): $(HIDL)
80$(GEN): PRIVATE_HIDL := $(HIDL)
81$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
82$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
83$(GEN): PRIVATE_CUSTOM_TOOL = \
84 $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
85 -Ljava \
86 -randroid.hardware:hardware/interfaces \
87 -randroid.hidl:system/libhidl/transport \
88 android.hardware.automotive.vehicle@2.1::types.VehicleProperty
89
90$(GEN): $(LOCAL_PATH)/types.hal
91 $(transform-generated-source)
92LOCAL_GENERATED_SOURCES += $(GEN)
93
94#
95# Build IVehicle.hal
96#
97GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
98$(GEN): $(HIDL)
99$(GEN): PRIVATE_HIDL := $(HIDL)
100$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVehicle.hal
101$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
102$(GEN): PRIVATE_CUSTOM_TOOL = \
103 $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
104 -Ljava \
105 -randroid.hardware:hardware/interfaces \
106 -randroid.hidl:system/libhidl/transport \
107 android.hardware.automotive.vehicle@2.1::IVehicle
108
109$(GEN): $(LOCAL_PATH)/IVehicle.hal
110 $(transform-generated-source)
111LOCAL_GENERATED_SOURCES += $(GEN)
112include $(BUILD_STATIC_JAVA_LIBRARY)
113
114
115
116include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/automotive/vehicle/2.1/IVehicle.hal b/automotive/vehicle/2.1/IVehicle.hal
new file mode 100644
index 00000000..5b6a23f4
--- /dev/null
+++ b/automotive/vehicle/2.1/IVehicle.hal
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.1
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.automotive.vehicle@2.1;
18
19import android.hardware.automotive.vehicle@2.0;
20
21/*
22 * New revision of IVehicle interface that supports properties defined in
23 * VehicleProperty enum version 2.1.
24 *
25 * NOTE: this HAL interface is under development and shouldn't be used in
26 * production.
27 *
28 * TODO(pavelm): update comment when this interface is ready for prod.
29 */
30interface IVehicle extends @2.0::IVehicle {
31};
diff --git a/automotive/vehicle/2.1/default/Android.mk b/automotive/vehicle/2.1/default/Android.mk
new file mode 100644
index 00000000..1874cb30
--- /dev/null
+++ b/automotive/vehicle/2.1/default/Android.mk
@@ -0,0 +1,84 @@
1# Copyright (C) 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17vhal_v2_0 = android.hardware.automotive.vehicle@2.0
18vhal_v2_1 = android.hardware.automotive.vehicle@2.1
19
20###############################################################################
21# Vehicle default VehicleHAL implementation
22###############################################################################
23include $(CLEAR_VARS)
24
25LOCAL_MODULE:= $(vhal_v2_1)-default-impl-lib
26
27LOCAL_C_INCLUDES := \
28 $(LOCAL_PATH)/impl/vhal_v2_1
29
30LOCAL_EXPORT_C_INCLUDE_DIRS := \
31 $(LOCAL_PATH)/impl
32
33
34# LOCAL_WHOLE_STATIC_LIBRARIES := \
35
36LOCAL_STATIC_LIBRARIES := \
37 $(vhal_v2_0)-default-impl-lib \
38 $(vhal_v2_0)-manager-lib \
39 $(vhal_v2_0)-libproto-native
40
41LOCAL_SHARED_LIBRARIES := \
42 libbinder \
43 libhidlbase \
44 libhidltransport \
45 libhwbinder \
46 liblog \
47 libutils \
48 libprotobuf-cpp-lite \
49 $(vhal_v2_0) \
50 $(vhal_v2_1) \
51
52include $(BUILD_STATIC_LIBRARY)
53
54###############################################################################
55# Vehicle HAL service
56###############################################################################
57include $(CLEAR_VARS)
58LOCAL_MODULE := $(vhal_v2_1)-service
59LOCAL_INIT_RC := $(vhal_v2_1)-service.rc
60LOCAL_MODULE_RELATIVE_PATH := hw
61
62LOCAL_SRC_FILES := \
63 service.cpp
64
65LOCAL_WHOLE_STATIC_LIBRARIES := \
66 $(vhal_v2_0)-libproto-native \
67
68LOCAL_STATIC_LIBRARIES := \
69 $(vhal_v2_0)-manager-lib \
70 $(vhal_v2_0)-default-impl-lib \
71 $(vhal_v2_1)-default-impl-lib \
72
73LOCAL_SHARED_LIBRARIES := \
74 libbinder \
75 libhidlbase \
76 libhidltransport \
77 libhwbinder \
78 liblog \
79 libutils \
80 libprotobuf-cpp-lite \
81 $(vhal_v2_0) \
82 $(vhal_v2_1) \
83
84include $(BUILD_EXECUTABLE)
diff --git a/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc b/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc
new file mode 100644
index 00000000..0b642d58
--- /dev/null
+++ b/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc
@@ -0,0 +1,4 @@
1service vehicle-hal-2.1 /system/bin/hw/android.hardware.automotive.vehicle@2.1-service
2 class hal
3 user vehicle_network
4 group system inet
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h
new file mode 100644
index 00000000..ab08cece
--- /dev/null
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_
18#define android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_
19
20#include <android/hardware/automotive/vehicle/2.1/types.h>
21#include <vhal_v2_0/VehicleUtils.h>
22
23namespace android {
24namespace hardware {
25namespace automotive {
26namespace vehicle {
27namespace V2_1 {
28
29namespace impl {
30
31const V2_0::VehiclePropConfig kVehicleProperties[] = {
32 {
33 .prop = V2_0::toInt(V2_1::VehicleProperty::WHEEL_TICK),
34 .access = V2_0::VehiclePropertyAccess::READ,
35 .changeMode = V2_0::VehiclePropertyChangeMode::CONTINUOUS,
36 }
37};
38
39} // impl
40
41} // namespace V2_1
42} // namespace vehicle
43} // namespace automotive
44} // namespace hardware
45} // namespace android
46
47#endif // android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h
new file mode 100644
index 00000000..7ccb3549
--- /dev/null
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultVehicleHal.h
@@ -0,0 +1,93 @@
1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef android_hardware_automotive_vehicle_V2_1_impl_DefaultVehicleHal_H_
18#define android_hardware_automotive_vehicle_V2_1_impl_DefaultVehicleHal_H_
19
20#include <memory>
21
22#include <utils/SystemClock.h>
23
24#include <vhal_v2_0/VehicleHal.h>
25#include <vhal_v2_0/DefaultVehicleHal.h>
26
27#include "DefaultConfig.h"
28
29namespace android {
30namespace hardware {
31namespace automotive {
32namespace vehicle {
33namespace V2_1 {
34
35namespace impl {
36
37using namespace std::placeholders;
38
39class DefaultVehicleHal : public V2_0::VehicleHal {
40public:
41 DefaultVehicleHal(V2_0::VehicleHal* vhal20) : mVehicleHal20(vhal20) {}
42
43 std::vector<V2_0::VehiclePropConfig> listProperties() override {
44 std::vector<V2_0::VehiclePropConfig> propConfigs(mVehicleHal20->listProperties());
45
46 // Join Vehicle Hal 2.0 and 2.1 configs.
47 propConfigs.insert(propConfigs.end(),
48 std::begin(kVehicleProperties),
49 std::end(kVehicleProperties));
50
51 return propConfigs;
52 }
53
54 VehiclePropValuePtr get(const V2_0::VehiclePropValue& requestedPropValue,
55 V2_0::StatusCode* outStatus) override {
56 // TODO(pavelm): put logic related to VHAL 2.1 here (OBD, VMS, etc)
57 return mVehicleHal20->get(requestedPropValue, outStatus);
58 }
59
60 V2_0::StatusCode set(const V2_0::VehiclePropValue& propValue) override {
61 return mVehicleHal20->set(propValue);
62 }
63
64 V2_0::StatusCode subscribe(int32_t property,
65 int32_t areas,
66 float sampleRate) override {
67 return mVehicleHal20->subscribe(property, areas, sampleRate);
68 }
69
70 V2_0::StatusCode unsubscribe(int32_t property) override {
71 return mVehicleHal20->unsubscribe(property);
72 }
73
74 void onCreate() override {
75 mVehicleHal20->init(getValuePool(),
76 std::bind(&DefaultVehicleHal::doHalEvent, this, _1),
77 std::bind(&DefaultVehicleHal::doHalPropertySetError, this, _1, _2, _3));
78 }
79
80private:
81 V2_0::VehicleHal* mVehicleHal20;
82};
83
84} // impl
85
86} // namespace V2_1
87} // namespace vehicle
88} // namespace automotive
89} // namespace hardware
90} // namespace android
91
92
93#endif // android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleHal_H_
diff --git a/automotive/vehicle/2.1/default/service.cpp b/automotive/vehicle/2.1/default/service.cpp
new file mode 100644
index 00000000..aaadf177
--- /dev/null
+++ b/automotive/vehicle/2.1/default/service.cpp
@@ -0,0 +1,97 @@
1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "automotive.vehicle@2.1-service"
18#include <android/log.h>
19#include <hidl/HidlTransportSupport.h>
20
21#include <iostream>
22
23#include <android/hardware/automotive/vehicle/2.1/IVehicle.h>
24
25#include <vhal_v2_0/VehicleHalManager.h>
26#include <vhal_v2_0/DefaultVehicleHal.h>
27
28#include <vhal_v2_1/DefaultVehicleHal.h>
29
30using namespace android;
31using namespace android::hardware;
32
33namespace V2_1 = ::android::hardware::automotive::vehicle::V2_1;
34namespace V2_0 = ::android::hardware::automotive::vehicle::V2_0;
35
36using StatusCode = V2_0::StatusCode;
37using VehiclePropValue = V2_0::VehiclePropValue;
38
39/* Just wrapper that passes all calls to the provided V2_0::IVehicle object */
40struct Vehicle_V2_1 : public V2_1::IVehicle {
41
42 Vehicle_V2_1(V2_0::IVehicle* vehicle20) : mVehicle20(vehicle20) {}
43
44 // Methods derived from IVehicle
45 Return<void> getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) override {
46 return mVehicle20->getAllPropConfigs(_hidl_cb);
47 }
48
49 Return<void> getPropConfigs(const hidl_vec<int32_t>& properties,
50 getPropConfigs_cb _hidl_cb) override {
51 return mVehicle20->getPropConfigs(properties, _hidl_cb);
52 }
53
54 Return<void> get(const V2_0::VehiclePropValue& requestedPropValue,
55 get_cb _hidl_cb) override {
56 return mVehicle20->get(requestedPropValue, _hidl_cb);
57 }
58
59 Return<StatusCode> set(const VehiclePropValue& value) override {
60 return mVehicle20->set(value);
61 }
62
63 Return<StatusCode> subscribe(const sp<V2_0::IVehicleCallback>& callback,
64 const hidl_vec<V2_0::SubscribeOptions>&
65 options) override {
66 return mVehicle20->subscribe(callback, options);
67 }
68
69 Return<StatusCode> unsubscribe(const sp<V2_0::IVehicleCallback>& callback,
70 int32_t propId) override {
71 return mVehicle20->unsubscribe(callback, propId);
72 }
73
74 Return<void> debugDump(debugDump_cb _hidl_cb = nullptr) override {
75 return mVehicle20->debugDump(_hidl_cb);
76 }
77
78private:
79 V2_0::IVehicle* mVehicle20;
80};
81
82int main(int /* argc */, char* /* argv */ []) {
83 auto halImpl20 = std::make_unique<V2_0::impl::DefaultVehicleHal>();
84 auto halImpl21 = std::make_unique<V2_1::impl::DefaultVehicleHal>(halImpl20.get());
85
86 auto vehicleManager = std::make_unique<V2_0::VehicleHalManager>(halImpl21.get());
87
88 Vehicle_V2_1 vehicle21(vehicleManager.get());
89
90 ALOGI("Registering as service...");
91 vehicle21.registerAsService("Vehicle");
92
93 configureRpcThreadpool(1, true /* callerWillJoin */);
94
95 ALOGI("Ready");
96 joinRpcThreadpool();
97}
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
new file mode 100644
index 00000000..5df1fbca
--- /dev/null
+++ b/automotive/vehicle/2.1/types.hal
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.1
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.automotive.vehicle@2.1;
18
19import android.hardware.automotive.vehicle@2.0;
20
21/*
22 * Extension of VehicleProperty enum declared in Vehicle HAL 2.0
23 */
24enum VehicleProperty: @2.0::VehicleProperty {
25 /*
26 * Reports wheel rotational distance in meters since last wheel tick
27 * event
28 *
29 * The value is a vector each element represents distance for individual
30 * wheel in the following order: left front, right front, left rear,
31 * right rear. VehiclePropValue.timestamp must be correctly filled in.
32 *
33 * Vendors must specify wheels that support this sensor in
34 * VehiclePropConfig.configFlags. The format of this field is a bitset of
35 * values from Wheel enum.
36 *
37 * @change_mode VehiclePropertyChangeMode:ON_CHANGE |VehiclePropertyChangeMode:CONTINUOUS
38 * @access VehiclePropertyAccess:READ
39 * @unit VehicleUnit:METER
40 */
41 WHEEL_TICK = (
42 0x0306
43 | VehiclePropertyGroup:SYSTEM
44 | VehiclePropertyType:FLOAT_VEC
45 | VehicleArea:GLOBAL),
46};