blob: a0fd29624ccd8c7368b4fe4f0ba1c94228a6570b [file] [log] [blame]
keunyounge18e25d2015-08-28 15:57:19 -07001/*
2 * Copyright (C) 2015 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 CAR_VEHICLE_NETWORK_SERVICE_H_
18#define CAR_VEHICLE_NETWORK_SERVICE_H_
19
Keun-young Park97e46eb2016-04-09 15:02:38 -070020#include <inttypes.h>
Pavel Maltsevb0324b42016-09-27 21:00:41 -070021#include <stdint.h>
keunyounge18e25d2015-08-28 15:57:19 -070022#include <sys/types.h>
Pavel Maltsevb0324b42016-09-27 21:00:41 -070023#include <unordered_set>
keunyounge18e25d2015-08-28 15:57:19 -070024
25#include <memory>
26
27#include <hardware/hardware.h>
28#include <hardware/vehicle.h>
29
30#include <binder/BinderService.h>
31#include <binder/IBinder.h>
32#include <binder/IPCThreadState.h>
33#include <cutils/compiler.h>
34#include <utils/threads.h>
35#include <utils/KeyedVector.h>
36#include <utils/List.h>
37#include <utils/RefBase.h>
38#include <utils/SortedVector.h>
39#include <utils/StrongPointer.h>
40#include <utils/TypeHelpers.h>
41
42#include <IVehicleNetwork.h>
43#include <IVehicleNetworkListener.h>
Keun-young Park28dd4702015-11-19 18:06:04 -080044#include <HandlerThread.h>
keunyounge18e25d2015-08-28 15:57:19 -070045
Sam Hurstc7152db2016-02-29 09:35:22 -080046#include "VehiclePropertyAccessControl.h"
keunyounge18e25d2015-08-28 15:57:19 -070047
48namespace android {
49
Keun-young Park28dd4702015-11-19 18:06:04 -080050// ----------------------------------------------------------------------------
51
keunyounge18e25d2015-08-28 15:57:19 -070052class VehicleNetworkService;
53
54/**
55 * MessageHandler to dispatch HAL callbacks to pre-defined handler thread context.
56 * Init / release is handled in the handler thread to allow upper layer to allocate resource
57 * for the thread.
58 */
59class VehicleHalMessageHandler : public MessageHandler {
60 enum {
keunyounge4c90c42015-11-16 18:42:52 -080061 HAL_EVENT = 0,
62 HAL_ERROR = 1,
keunyounge18e25d2015-08-28 15:57:19 -070063 };
64
65 /**
66 * For dispatching HAL event in batch. Hal events coming in this time frame will be batched
67 * together.
68 */
69 static const int DISPATCH_INTERVAL_MS = 16;
Keun-young Park28dd4702015-11-19 18:06:04 -080070 static const int NUM_PROPERTY_EVENT_LISTS = 2;
keunyounge18e25d2015-08-28 15:57:19 -070071public:
Keun-young Park28dd4702015-11-19 18:06:04 -080072 // not passing VNS as sp as this is held by VNS always.
keunyounge18e25d2015-08-28 15:57:19 -070073 VehicleHalMessageHandler(const sp<Looper>& mLooper, VehicleNetworkService& service);
74 virtual ~VehicleHalMessageHandler();
75
keunyounge18e25d2015-08-28 15:57:19 -070076 void handleHalEvent(vehicle_prop_value_t *eventData);
Keun-young Park28dd4702015-11-19 18:06:04 -080077 void handleHalError(VehicleHalError* error);
Keun-young Park7151bb32016-10-12 21:14:19 -070078 void handleMockStateChange();
Keun-young Park97e46eb2016-04-09 15:02:38 -070079 void dump(String8& msg);
keunyounge18e25d2015-08-28 15:57:19 -070080
81private:
82 void handleMessage(const Message& message);
keunyounge18e25d2015-08-28 15:57:19 -070083 void doHandleHalEvent();
84 void doHandleHalError();
85
86private:
Keun-young Park28dd4702015-11-19 18:06:04 -080087 mutable Mutex mLock;
Keun-young Park28dd4702015-11-19 18:06:04 -080088 const sp<Looper> mLooper;
keunyounge18e25d2015-08-28 15:57:19 -070089 VehicleNetworkService& mService;
keunyounge18e25d2015-08-28 15:57:19 -070090 int mFreeListIndex;
Keun-young Park28dd4702015-11-19 18:06:04 -080091 List<vehicle_prop_value_t*> mHalPropertyList[NUM_PROPERTY_EVENT_LISTS];
keunyounge18e25d2015-08-28 15:57:19 -070092 int64_t mLastDispatchTime;
Keun-young Park28dd4702015-11-19 18:06:04 -080093 List<VehicleHalError*> mHalErrors;
keunyounge18e25d2015-08-28 15:57:19 -070094};
Keun-young Park0727f952015-12-21 14:30:07 -080095// ----------------------------------------------------------------------------
96class SubscriptionInfo {
97public:
98 float sampleRate;
99 int32_t zones;
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700100 int32_t flags;
Keun-young Park0727f952015-12-21 14:30:07 -0800101 SubscriptionInfo()
102 : sampleRate(0),
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700103 zones(0),
104 flags(SubscribeFlags::DEFAULT) {};
105 SubscriptionInfo(float aSampleRate, int32_t aZones, int32_t aFlags)
Keun-young Park0727f952015-12-21 14:30:07 -0800106 : sampleRate(aSampleRate),
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700107 zones(aZones),
108 flags(aFlags) {};
Keun-young Park0727f952015-12-21 14:30:07 -0800109 SubscriptionInfo(const SubscriptionInfo& info)
110 : sampleRate(info.sampleRate),
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700111 zones(info.zones),
112 flags(info.flags) {};
Keun-young Park0727f952015-12-21 14:30:07 -0800113};
keunyounge18e25d2015-08-28 15:57:19 -0700114
115// ----------------------------------------------------------------------------
Keun-young Park6748b412016-04-07 15:51:09 -0700116class EventInfo {
117public:
118 int64_t lastTimestamp;
119 int eventCount;
120 EventInfo()
121 : lastTimestamp(0),
122 eventCount(0) {};
123 EventInfo(int64_t aLastTimestamp, int aEventCount)
124 : lastTimestamp(aLastTimestamp),
125 eventCount(aEventCount) {};
126 EventInfo(const EventInfo& info)
127 : lastTimestamp(info.lastTimestamp),
128 eventCount(info.eventCount) {};
129};
130// ----------------------------------------------------------------------------
keunyounge18e25d2015-08-28 15:57:19 -0700131
132class HalClient : public virtual RefBase {
133public:
Keun-young Park28dd4702015-11-19 18:06:04 -0800134 HalClient(const sp<IVehicleNetworkListener> &listener, pid_t pid, uid_t uid) :
135 mListener(listener),
136 mPid(pid),
137 mUid(uid),
138 mMonitoringHalRestart(false),
Keun-young Park97e46eb2016-04-09 15:02:38 -0700139 mMonitoringHalError(false),
140 mLastDispatchedEventCounts(0),
141 mTotalDispatchedEvents(0),
142 mLastDispatchTime(0) {
keunyounge18e25d2015-08-28 15:57:19 -0700143 }
144
Keun-young Park7151bb32016-10-12 21:14:19 -0700145 virtual ~HalClient() {
Keun-young Park0727f952015-12-21 14:30:07 -0800146 mSubscriptionInfos.clear();
keunyounge18e25d2015-08-28 15:57:19 -0700147 }
148
149 pid_t getPid() {
150 return mPid;
151 }
152
153 uid_t getUid() {
154 return mUid;
155 }
156
Keun-young Park0727f952015-12-21 14:30:07 -0800157 SubscriptionInfo* getSubscriptionInfo(int32_t property) {
keunyounge18e25d2015-08-28 15:57:19 -0700158 Mutex::Autolock autoLock(mLock);
Keun-young Park0727f952015-12-21 14:30:07 -0800159 ssize_t index = mSubscriptionInfos.indexOfKey(property);
keunyounge18e25d2015-08-28 15:57:19 -0700160 if (index < 0) {
Keun-young Park0727f952015-12-21 14:30:07 -0800161 return NULL;
keunyounge18e25d2015-08-28 15:57:19 -0700162 }
Keun-young Park0727f952015-12-21 14:30:07 -0800163 return &mSubscriptionInfos.editValueAt(index);
keunyounge18e25d2015-08-28 15:57:19 -0700164 }
165
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700166 void setSubscriptionInfo(int32_t property, float sampleRate, int32_t zones, int32_t flags) {
keunyounge18e25d2015-08-28 15:57:19 -0700167 Mutex::Autolock autoLock(mLock);
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700168 SubscriptionInfo info(sampleRate, zones, flags);
Keun-young Park0727f952015-12-21 14:30:07 -0800169 mSubscriptionInfos.add(property, info);
keunyounge18e25d2015-08-28 15:57:19 -0700170 }
171
172 bool removePropertyAndCheckIfActive(int32_t property) {
Keun-young Park28dd4702015-11-19 18:06:04 -0800173 Mutex::Autolock autoLock(mLock);
Keun-young Park0727f952015-12-21 14:30:07 -0800174 mSubscriptionInfos.removeItem(property);
175 return mSubscriptionInfos.size() > 0 || mMonitoringHalRestart || mMonitoringHalError;
Keun-young Park28dd4702015-11-19 18:06:04 -0800176 }
177
178 void removeAllProperties() {
179 Mutex::Autolock autoLock(mLock);
Keun-young Park0727f952015-12-21 14:30:07 -0800180 mSubscriptionInfos.clear();
Keun-young Park28dd4702015-11-19 18:06:04 -0800181 }
182
183 bool isActive() {
184 Mutex::Autolock autoLock(mLock);
Keun-young Park0727f952015-12-21 14:30:07 -0800185 return mSubscriptionInfos.size() > 0 || mMonitoringHalRestart || mMonitoringHalError;
Keun-young Park28dd4702015-11-19 18:06:04 -0800186 }
187
188 void setHalRestartMonitoringState(bool state) {
189 Mutex::Autolock autoLock(mLock);
190 mMonitoringHalRestart = state;
191 }
192
193 bool isMonitoringHalRestart() {
194 Mutex::Autolock autoLock(mLock);
195 return mMonitoringHalRestart;
196 }
197
198 void setHalErrorMonitoringState(bool state) {
199 Mutex::Autolock autoLock(mLock);
200 mMonitoringHalError = state;
201 }
202
203 bool isMonitoringHalError() {
204 Mutex::Autolock autoLock(mLock);
205 return mMonitoringHalError;
keunyounge18e25d2015-08-28 15:57:19 -0700206 }
207
208 const sp<IVehicleNetworkListener>& getListener() {
209 return mListener;
210 }
211
212 const sp<IBinder> getListenerAsBinder() {
213 return IInterface::asBinder(mListener);
214 }
215
216 // no lock here as this should be called only from single event looper thread
217 void addEvent(vehicle_prop_value_t* event) {
218 mEvents.push_back(event);
219 }
220
221 // no lock here as this should be called only from single event looper thread
222 void clearEvents() {
223 mEvents.clear();
224 }
225
226 // no lock here as this should be called only from single event looper thread
227 List<vehicle_prop_value_t*>& getEventList() {
228 return mEvents;
229 }
230
231 // no lock here as this should be called only from single event looper thread
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700232 status_t dispatchEvents(const int64_t& timestamp) {
Pavel Maltseve5314732016-06-28 16:51:26 -0700233 ALOGV("dispatchEvents, num Events:%zu", mEvents.size());
keunyounge18e25d2015-08-28 15:57:19 -0700234 sp<VehiclePropValueListHolder> events(new VehiclePropValueListHolder(&mEvents,
235 false /*deleteInDestructor */));
236 ASSERT_OR_HANDLE_NO_MEMORY(events.get(), return NO_MEMORY);
Keun-young Park97e46eb2016-04-09 15:02:38 -0700237 mLastDispatchTime = timestamp;
238 mLastDispatchedEventCounts = mEvents.size();
239 mTotalDispatchedEvents += mLastDispatchedEventCounts;
keunyounge18e25d2015-08-28 15:57:19 -0700240 mListener->onEvents(events);
241 mEvents.clear();
242 return NO_ERROR;
243 }
Keun-young Park28dd4702015-11-19 18:06:04 -0800244
245 void dispatchHalError(int32_t errorCode, int32_t property, int32_t operation) {
246 mListener->onHalError(errorCode, property, operation);
247 }
248
249 void dispatchHalRestart(bool inMocking) {
250 mListener->onHalRestart(inMocking);
251 }
252
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700253 void dispatchPropertySetEvent(const vehicle_prop_value_t& value) {
254 mListener->onPropertySet(value);
255 }
256
Keun-young Park97e46eb2016-04-09 15:02:38 -0700257 void dump(String8& msg) {
258 msg.appendFormat("pid:%d, uid:%d, mLastDispatchedEventCounts:%d, mTotalDispatchedEvents:%d"
259 ", mLastDispatchTime:%" PRId64 "\n",
260 mPid, mUid, mLastDispatchedEventCounts, mTotalDispatchedEvents, mLastDispatchTime);
261 }
262
keunyounge18e25d2015-08-28 15:57:19 -0700263private:
Keun-young Park28dd4702015-11-19 18:06:04 -0800264 mutable Mutex mLock;
265 const sp<IVehicleNetworkListener> mListener;
266 const pid_t mPid;
267 const uid_t mUid;
Keun-young Park0727f952015-12-21 14:30:07 -0800268 KeyedVector<int32_t, SubscriptionInfo> mSubscriptionInfos;
keunyounge18e25d2015-08-28 15:57:19 -0700269 List<vehicle_prop_value_t*> mEvents;
Keun-young Park28dd4702015-11-19 18:06:04 -0800270 bool mMonitoringHalRestart;
271 bool mMonitoringHalError;
Keun-young Park97e46eb2016-04-09 15:02:38 -0700272 int mLastDispatchedEventCounts;
273 int mTotalDispatchedEvents;
274 int64_t mLastDispatchTime;
keunyounge18e25d2015-08-28 15:57:19 -0700275};
276
277class HalClientSpVector : public SortedVector<sp<HalClient> >, public RefBase {
Keun-young Park7151bb32016-10-12 21:14:19 -0700278public:
279 virtual ~HalClientSpVector() {};
keunyounge18e25d2015-08-28 15:57:19 -0700280protected:
281 virtual int do_compare(const void* lhs, const void* rhs) const {
282 sp<HalClient>& lh = * (sp<HalClient> * )(lhs);
283 sp<HalClient>& rh = * (sp<HalClient> * )(rhs);
284 return compare_type(lh.get(), rh.get());
285 }
286};
287
288// ----------------------------------------------------------------------------
289
keunyoungd32f4e62015-09-21 11:33:06 -0700290/**
291 * Keeps cached value of property values.
292 * For internal property, static property, and on_change property, caching makes sense.
293 */
294class PropertyValueCache {
295public:
296 PropertyValueCache();
297 virtual ~PropertyValueCache();
298 void writeToCache(const vehicle_prop_value_t& value);
299 bool readFromCache(vehicle_prop_value_t* value);
300
301private:
302 KeyedVector<int32_t, vehicle_prop_value_t*> mCache;
303};
304
305// ----------------------------------------------------------------------------
306
Keun-young Park28dd4702015-11-19 18:06:04 -0800307class MockDeathHandler: public IBinder::DeathRecipient {
308public:
309 MockDeathHandler(VehicleNetworkService& vns) :
310 mService(vns) {};
Keun-young Park7151bb32016-10-12 21:14:19 -0700311 virtual ~MockDeathHandler() {};
Keun-young Park28dd4702015-11-19 18:06:04 -0800312 virtual void binderDied(const wp<IBinder>& who);
313
314private:
315 VehicleNetworkService& mService;
316};
317
318// ----------------------------------------------------------------------------
keunyounge18e25d2015-08-28 15:57:19 -0700319class VehicleNetworkService :
320 public BinderService<VehicleNetworkService>,
321 public BnVehicleNetwork,
322 public IBinder::DeathRecipient {
323public:
324 static const char* getServiceName() ANDROID_API { return IVehicleNetwork::SERVICE_NAME; };
325
326 VehicleNetworkService();
Keun-young Park7151bb32016-10-12 21:14:19 -0700327 virtual ~VehicleNetworkService();
keunyounge18e25d2015-08-28 15:57:19 -0700328 virtual status_t dump(int fd, const Vector<String16>& args);
329 void release();
Keun-young Park7151bb32016-10-12 21:14:19 -0700330 status_t onHalEvent(const vehicle_prop_value_t *eventData, bool isInjection = false,
331 bool doCopy = true);
Keun-young Park28dd4702015-11-19 18:06:04 -0800332 status_t onHalError(int32_t errorCode, int32_t property, int32_t operation,
333 bool isInjection = false);
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700334 status_t onPropertySet(const vehicle_prop_value_t& eventData);
keunyounge18e25d2015-08-28 15:57:19 -0700335 /**
336 * Called by VehicleHalMessageHandler for batching events
337 */
Keun-young Park28dd4702015-11-19 18:06:04 -0800338 void dispatchHalEvents(List<vehicle_prop_value_t*>& events);
339 void dispatchHalError(VehicleHalError* error);
keunyounge18e25d2015-08-28 15:57:19 -0700340 virtual sp<VehiclePropertiesHolder> listProperties(int32_t property = 0);
341 virtual status_t setProperty(const vehicle_prop_value_t& value);
342 virtual status_t getProperty(vehicle_prop_value_t* value);
Keun-young Park71b2f5c2016-03-10 18:44:40 -0800343 virtual void releaseMemoryFromGet(vehicle_prop_value_t* value);
keunyounge18e25d2015-08-28 15:57:19 -0700344 virtual status_t subscribe(const sp<IVehicleNetworkListener> &listener, int32_t property,
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700345 float sampleRate, int32_t zones, int32_t flags = SubscribeFlags::DEFAULT);
keunyounge18e25d2015-08-28 15:57:19 -0700346 virtual void unsubscribe(const sp<IVehicleNetworkListener> &listener, int32_t property);
keunyoung1ab8e182015-09-24 09:25:22 -0700347 virtual status_t injectEvent(const vehicle_prop_value_t& value);
348 virtual status_t startMocking(const sp<IVehicleNetworkHalMock>& mock);
349 virtual void stopMocking(const sp<IVehicleNetworkHalMock>& mock);
Keun-young Park28dd4702015-11-19 18:06:04 -0800350 virtual status_t injectHalError(int32_t errorCode, int32_t property, int32_t operation);
351 virtual status_t startErrorListening(const sp<IVehicleNetworkListener> &listener);
352 virtual void stopErrorListening(const sp<IVehicleNetworkListener> &listener);
353 virtual status_t startHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener);
354 virtual void stopHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener);
keunyounge18e25d2015-08-28 15:57:19 -0700355 virtual void binderDied(const wp<IBinder>& who);
keunyoungd32f4e62015-09-21 11:33:06 -0700356 bool isPropertySubsribed(int32_t property);
Keun-young Park28dd4702015-11-19 18:06:04 -0800357
358 void handleHalMockDeath(const wp<IBinder>& who);
Keun-young Park737cdfb2016-02-12 15:11:39 -0800359protected:
360 virtual bool isOperationAllowed(int32_t property, bool isWrite);
keunyounge18e25d2015-08-28 15:57:19 -0700361private:
362 // RefBase
363 virtual void onFirstRef();
364 status_t loadHal();
365 void closeHal();
keunyoung1ab8e182015-09-24 09:25:22 -0700366 vehicle_prop_config_t const * findConfigLocked(int32_t property);
367 bool isGettableLocked(int32_t property);
keunyoung38ba5302015-10-14 13:50:21 -0700368 bool isSettableLocked(int32_t property, int32_t valueType);
keunyoung1ab8e182015-09-24 09:25:22 -0700369 bool isSubscribableLocked(int32_t property);
Pavel Maltsevdfccc5a2016-04-11 21:56:04 -0700370 status_t getProperty(vehicle_prop_value_t *data, bool retry);
Keun-young Park0727f952015-12-21 14:30:07 -0800371 static bool isZonedProperty(vehicle_prop_config_t const * config);
Keun-young Park28dd4702015-11-19 18:06:04 -0800372 sp<HalClient> findClientLocked(sp<IBinder>& ibinder);
373 sp<HalClient> findOrCreateClientLocked(sp<IBinder>& ibinder,
374 const sp<IVehicleNetworkListener> &listener);
375 sp<HalClientSpVector> findClientsVectorForPropertyLocked(int32_t property);
376 sp<HalClientSpVector> findOrCreateClientsVectorForPropertyLocked(int32_t property);
377 bool removePropertyFromClientLocked(sp<IBinder>& ibinder, sp<HalClient>& client,
378 int32_t property);
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700379 bool hasClientsSubscribedToSetCallLocked(int32_t property,
380 const sp<HalClientSpVector> &clientsForProperty) const;
Keun-young Park28dd4702015-11-19 18:06:04 -0800381 void handleHalRestartAndGetClientsToDispatchLocked(List<sp<HalClient> >& clientsToDispatch);
Pavel Maltsevdfccc5a2016-04-11 21:56:04 -0700382 status_t notifyClientWithCurrentValue(bool isMocking, const vehicle_prop_config_t *config,
383 int32_t zones);
384 status_t notifyClientWithCurrentValue(bool isMocking, int32_t prop, int32_t valueType,
385 int32_t zone);
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700386 void dispatchPropertySetEvent(const vehicle_prop_value_t& data,
387 const sp<HalClientSpVector>& propertyClients);
Keun-young Park28dd4702015-11-19 18:06:04 -0800388
keunyounge18e25d2015-08-28 15:57:19 -0700389 static int eventCallback(const vehicle_prop_value_t *eventData);
keunyoung38ba5302015-10-14 13:50:21 -0700390 static int errorCallback(int32_t errorCode, int32_t property, int32_t operation);
keunyounge18e25d2015-08-28 15:57:19 -0700391private:
Keun-young Parke78bf532016-04-25 18:59:22 -0700392 static const int GET_SET_WAIT_TIME_US = 100000;
393 static const int MAX_GET_SET_RETRY_NUMBER_FOR_NOT_READY = 20;
Keun-young Park71b2f5c2016-03-10 18:44:40 -0800394
Sam Hurstc7152db2016-02-29 09:35:22 -0800395 VehiclePropertyAccessControl mVehiclePropertyAccessControl;
keunyounge18e25d2015-08-28 15:57:19 -0700396 static VehicleNetworkService* sInstance;
Keun-young Park28dd4702015-11-19 18:06:04 -0800397 sp<HandlerThread> mHandlerThread;
keunyounge18e25d2015-08-28 15:57:19 -0700398 sp<VehicleHalMessageHandler> mHandler;
399 mutable Mutex mLock;
400 vehicle_module_t* mModule;
401 vehicle_hw_device_t* mDevice;
402 sp<VehiclePropertiesHolder> mProperties;
403 KeyedVector<sp<IBinder>, sp<HalClient> > mBinderToClientMap;
Keun-young Park28dd4702015-11-19 18:06:04 -0800404 // client subscribing properties
keunyounge18e25d2015-08-28 15:57:19 -0700405 KeyedVector<int32_t, sp<HalClientSpVector> > mPropertyToClientsMap;
Keun-young Park0727f952015-12-21 14:30:07 -0800406 KeyedVector<int32_t, SubscriptionInfo> mSubscriptionInfos;
Keun-young Park6748b412016-04-07 15:51:09 -0700407 KeyedVector<int32_t, EventInfo> mEventInfos;
Pavel Maltsevb0324b42016-09-27 21:00:41 -0700408 std::unordered_set<int32_t> mPropertiesSubscribedToSetCall;
keunyoungd32f4e62015-09-21 11:33:06 -0700409 PropertyValueCache mCache;
keunyoung1ab8e182015-09-24 09:25:22 -0700410 bool mMockingEnabled;
Keun-young Park97e46eb2016-04-09 15:02:38 -0700411 int mDroppedEventsWhileInMocking;
412 int64_t mLastEventDropTimeWhileInMocking;
keunyoung1ab8e182015-09-24 09:25:22 -0700413 sp<IVehicleNetworkHalMock> mHalMock;
414 sp<VehiclePropertiesHolder> mPropertiesForMocking;
Keun-young Park28dd4702015-11-19 18:06:04 -0800415 sp<MockDeathHandler> mHalMockDeathHandler;
keunyounge18e25d2015-08-28 15:57:19 -0700416};
417
418};
419
420#endif /* CAR_VEHICLE_NETWORK_SERVICE_H_ */