Remove Vehicle Network Service

It was replaced by Vehicle HAL

Bug: b/34361484

Test: removing dead code
Change-Id: Ib6f9641bc98d53ea1fe87d245aa7792be5650532
diff --git a/car_product/build/car.mk b/car_product/build/car.mk
index 5928164..effda9f 100644
--- a/car_product/build/car.mk
+++ b/car_product/build/car.mk
@@ -77,7 +77,6 @@
 
 # Automotive specific packages
 PRODUCT_PACKAGES += \
-    vehicle_network_service \
     vehicle_monitor_service \
     CarService \
     CarUiProvider \
@@ -93,9 +92,7 @@
     CarMapsPlaceholder \
     CarUsbHandler \
     android.car \
-    libvehiclenetwork-native \
     libvehiclemonitor-native \
-    vns_policy.xml \
 
 # Boot animation
 PRODUCT_COPY_FILES += \
diff --git a/libvehiclenetwork/Android.mk b/libvehiclenetwork/Android.mk
deleted file mode 100644
index d114831..0000000
--- a/libvehiclenetwork/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2015 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)
-# Include the sub-makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/libvehiclenetwork/include/HandlerThread.h b/libvehiclenetwork/include/HandlerThread.h
deleted file mode 100644
index 68d8625..0000000
--- a/libvehiclenetwork/include/HandlerThread.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2015 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 CAR_HANDLER_THREAD_H_
-#define CAR_HANDLER_THREAD_H_
-
-#include <utils/Looper.h>
-#include <utils/threads.h>
-
-namespace android {
-
-/**
- * Native HandlerThread implementation looking similar to Java version.
- */
-class HandlerThread : public Thread {
-public:
-    HandlerThread();
-    virtual ~HandlerThread();
-
-    sp<Looper> getLooper();
-    status_t start(const char* name = 0, int32_t priority = PRIORITY_DEFAULT, size_t stack = 0);
-    void quit();
-
-private:
-    bool threadLoop();
-
-private:
-    sp<Looper> mLooper;
-    mutable Mutex mLock;
-    bool mShouldQuit;
-    Condition mLooperWait;
-};
-
-};
-
-#endif /* CAR_HANDLER_THREAD_H_ */
diff --git a/libvehiclenetwork/include/IVehicleNetwork.h b/libvehiclenetwork/include/IVehicleNetwork.h
deleted file mode 100644
index dd17442..0000000
--- a/libvehiclenetwork/include/IVehicleNetwork.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2015 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_IVEHICLE_NETWORK_H
-#define ANDROID_IVEHICLE_NETWORK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <hardware/vehicle.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
-#include <binder/IMemory.h>
-#include <binder/Parcel.h>
-
-#include <VehicleNetworkDataTypes.h>
-#include <IVehicleNetworkHalMock.h>
-#include <IVehicleNetworkListener.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class IVehicleNetwork : public IInterface {
-public:
-    static const char SERVICE_NAME[];
-    DECLARE_META_INTERFACE(VehicleNetwork);
-
-    /**
-     * Return configuration of single property (when argument property is not 0) or all properties
-     * (when property = 0).
-     */
-    virtual sp<VehiclePropertiesHolder> listProperties(int32_t property = 0) = 0;
-    virtual status_t setProperty(const vehicle_prop_value_t& value)= 0;
-    virtual status_t getProperty(vehicle_prop_value_t* value) = 0;
-    virtual status_t subscribe(const sp<IVehicleNetworkListener> &listener, int32_t property,
-            float sampleRate, int32_t zones, int32_t flags = 0) = 0;
-    virtual void unsubscribe(const sp<IVehicleNetworkListener> &listener, int32_t property) = 0;
-    /**
-     * Inject event for given property. This should work regardless of mocking but usually
-     * used in mocking.
-     */
-    virtual status_t injectEvent(const vehicle_prop_value_t& value) = 0;
-    virtual status_t startMocking(const sp<IVehicleNetworkHalMock>& mock) = 0;
-    virtual void stopMocking(const sp<IVehicleNetworkHalMock>& mock) = 0;
-    virtual status_t injectHalError(int32_t errorCode, int32_t property, int32_t operation) = 0;
-    /**
-     * Register listener and listen for global error from vehicle hal.
-     * Per property error will be delivered when the property is subscribed or global error listener
-     * where there is no subscription.
-     */
-    virtual status_t startErrorListening(const sp<IVehicleNetworkListener> &listener) = 0;
-    virtual void stopErrorListening(const sp<IVehicleNetworkListener> &listener) = 0;
-    /**
-     * Listen for HAL restart. When HAL restarts, as in case of starting or stopping mocking,
-     * all existing subscription becomes invalid.
-     */
-    virtual status_t startHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener) = 0;
-    virtual void stopHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnVehicleNetwork : public BnInterface<IVehicleNetwork> {
-    virtual status_t  onTransact(uint32_t code,
-                                 const Parcel& data,
-                                 Parcel* reply,
-                                 uint32_t flags = 0);
-    virtual bool isOperationAllowed(int32_t property, bool isWrite) = 0;
-    virtual void releaseMemoryFromGet(vehicle_prop_value_t* value) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class VehicleNetworkUtil {
-public:
-    static int countNumberOfZones(int32_t zones) {
-        if (zones == 0) { // no-zone, treat as one zone.
-            return 1;
-        }
-        int count = 0;
-        uint32_t flag = 0x1;
-        for (int i = 0; i < 32; i++) {
-            if ((flag & zones) != 0) {
-                count++;
-            }
-            flag <<= 1;
-        }
-        return count;
-    }
-};
-
-struct SubscribeFlags {
-    enum : int32_t {
-        UNDEFINED = 0x00,
-        HAL_EVENT = 0x01,
-        SET_CALL  = 0x02,
-
-        DEFAULT = HAL_EVENT,
-    };
-};
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif /* ANDROID_IVEHICLE_NETWORK_H */
diff --git a/libvehiclenetwork/include/IVehicleNetworkHalMock.h b/libvehiclenetwork/include/IVehicleNetworkHalMock.h
deleted file mode 100644
index b69d820..0000000
--- a/libvehiclenetwork/include/IVehicleNetworkHalMock.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2015 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_IVEHICLE_NETWORK_HAL_MOCK_H
-#define ANDROID_IVEHICLE_NETWORK_HAL_MOCK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
-#include <binder/IMemory.h>
-#include <binder/Parcel.h>
-
-#include <VehicleNetworkDataTypes.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class IVehicleNetworkHalMock : public IInterface
-{
-public:
-    static const char SERVICE_NAME[];
-    DECLARE_META_INTERFACE(VehicleNetworkHalMock);
-
-    virtual sp<VehiclePropertiesHolder> onListProperties() = 0;
-    virtual status_t onPropertySet(const vehicle_prop_value_t& value) = 0;
-    virtual status_t onPropertyGet(vehicle_prop_value_t* value) = 0;
-    virtual status_t onPropertySubscribe(int32_t property, float sampleRate, int32_t zones) = 0;
-    virtual void onPropertyUnsubscribe(int32_t property) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnVehicleNetworkHalMock : public BnInterface<IVehicleNetworkHalMock>
-{
-    virtual status_t  onTransact(uint32_t code,
-                                 const Parcel& data,
-                                 Parcel* reply,
-                                 uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif /* ANDROID_IVEHICLE_NETWORK_HAL_MOCK_H */
diff --git a/libvehiclenetwork/include/IVehicleNetworkListener.h b/libvehiclenetwork/include/IVehicleNetworkListener.h
deleted file mode 100644
index 9f84f81..0000000
--- a/libvehiclenetwork/include/IVehicleNetworkListener.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2015 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_IVEHICLE_NETWORK_LISTENER_H
-#define ANDROID_IVEHICLE_NETWORK_LISTENER_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
-#include <binder/IMemory.h>
-#include <binder/Parcel.h>
-
-#include <VehicleNetworkDataTypes.h>
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class IVehicleNetworkListener : public IInterface
-{
-public:
-    DECLARE_META_INTERFACE(VehicleNetworkListener);
-
-    /**
-     * Pass events contained in VehiclePropValueListHolder. Client (Bn implementor) should
-     * hold sp to keep the data received outside this call.
-     */
-    virtual void onEvents(sp<VehiclePropValueListHolder>& events) = 0;
-    /**
-     * Notify error in HAL. For this to be called, either the target property is subscribed
-     * or client should explicitly call registerErrorListener.
-     * @param errorCode
-     * @param property Specific property where the error happened. 0 is for global error.
-     * @param operation
-     */
-    virtual void onHalError(int32_t errorCode, int32_t property, int32_t operation) = 0;
-    /**
-     * HAL is restarting. All subscription becomes invalid after this.
-     * @param inMocking Whether it is in mocking mode or not.
-     */
-    virtual void onHalRestart(bool inMocking) = 0;
-
-    /**
-     * This method gets called if this listener was susbscribed to a property using
-     * SubscribeFlags::SET_CALL flag and set property method was called in
-     * Vehicle Network Service.
-     *
-     * @param value Value that was set by a Vehicle Network Service client.
-     */
-    virtual void onPropertySet(const vehicle_prop_value_t& value) = 0;;
-};
-
-// ----------------------------------------------------------------------------
-
-class BnVehicleNetworkListener : public BnInterface<IVehicleNetworkListener>
-{
-    virtual status_t  onTransact(uint32_t code,
-                                 const Parcel& data,
-                                 Parcel* reply,
-                                 uint32_t flags = 0);
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif /* ANDROID_IVEHICLE_NETWORK_LISTENER_H */
diff --git a/libvehiclenetwork/include/VehicleNetwork.h b/libvehiclenetwork/include/VehicleNetwork.h
deleted file mode 100644
index f39af66..0000000
--- a/libvehiclenetwork/include/VehicleNetwork.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_NETWORK_H
-#define ANDROID_VEHICLE_NETWORK_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <binder/IInterface.h>
-#include <binder/IMemory.h>
-
-#include <utils/threads.h>
-#include <utils/Errors.h>
-#include <utils/List.h>
-#include <utils/RefBase.h>
-
-#include "IVehicleNetwork.h"
-#include "HandlerThread.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-/**
- * Listener for client to implement to get events from Vehicle network service.
- */
-class VehicleNetworkListener : public RefBase
-{
-public:
-    VehicleNetworkListener() {};
-    virtual ~VehicleNetworkListener() {};
-    virtual void onEvents(sp<VehiclePropValueListHolder>& events) = 0;
-    virtual void onHalError(int32_t errorCode, int32_t property, int32_t operation) = 0;
-    virtual void onHalRestart(bool inMocking) = 0;
-    virtual void onPropertySet(const vehicle_prop_value_t& value) = 0;
-};
-
-// ----------------------------------------------------------------------------
-
-/** For internal event handling, not for client */
-class VehicleNetworkEventMessageHandler : public MessageHandler {
-    enum {
-        EVENT_EVENTS = 0,
-        EVENT_HAL_ERROR = 1,
-        EVENT_HAL_RESTART = 2,
-        EVENT_ON_SET = 3,
-    };
-public:
-    VehicleNetworkEventMessageHandler(const sp<Looper>& looper,
-            sp<VehicleNetworkListener>& listener);
-    virtual ~VehicleNetworkEventMessageHandler();
-
-    void handleHalEvents(sp<VehiclePropValueListHolder>& events);
-    void handleHalError(int32_t errorCode, int32_t property, int32_t operation);
-    /**
-     * This error must be handled always. This can be called in vehicle network service's crash
-     * as well.
-     */
-    void handleHalRestart(bool inMocking);
-
-    void handleOnPropertySet(const vehicle_prop_value_t& value);
-
-private:
-    virtual void handleMessage(const Message& message);
-    void doHandleHalEvents();
-    void doHandleHalError();
-    void doHandleHalRestart();
-    void doHandleOnPropertySet();
-private:
-    mutable Mutex mLock;
-    sp<Looper> mLooper;
-    sp<VehicleNetworkListener>& mListener;
-    List<sp<VehiclePropValueListHolder>> mEvents;
-    List<VehicleHalError*> mHalErrors;
-    List<bool> mHalRestartEvents;
-    List<vehicle_prop_value_t*> mSetValueEvents;
-};
-
-// ----------------------------------------------------------------------------
-
-/**
- * Vehicle network API for low level components like HALs to access / control car information.
- * This is reference counted. So use with sp<>.
- */
-class VehicleNetwork : public IBinder::DeathRecipient, public BnVehicleNetworkListener
-{
-public:
-    /**
-     * Factory method for VehicleNetwork. Client should use this method to create
-     * a new instance.
-     */
-    static sp<VehicleNetwork> createVehicleNetwork(sp<VehicleNetworkListener> &listener);
-
-    virtual ~VehicleNetwork();
-
-    /** Set int32 value */
-    status_t setInt32Property(int32_t property, int32_t value);
-    /** get int32 value */
-    status_t getInt32Property(int32_t property, int32_t* value, int64_t* timestamp);
-    status_t setInt64Property(int32_t property, int64_t value);
-    status_t getInt64Property(int32_t property, int64_t* value, int64_t* timestamp);
-    status_t setFloatProperty(int32_t property, float value);
-    status_t getFloatProperty(int32_t property, float* value, int64_t* timestamp);
-    status_t setStringProperty(int32_t property, const String8& value);
-    status_t getStringProperty(int32_t property, String8& value, int64_t* timestamp);
-    sp<VehiclePropertiesHolder> listProperties(int32_t property = 0);
-    /** For generic value setting. At least prop, value_type, and value should be set. */
-    status_t setProperty(const vehicle_prop_value_t& value);
-    /** For generic value getting. value->prop should be set. */
-    status_t getProperty(vehicle_prop_value_t* value);
-    status_t subscribe(int32_t property, float sampleRate, int32_t zones = 0,
-                       int32_t flags = SubscribeFlags::DEFAULT);
-    void unsubscribe(int32_t property);
-
-    // Only for testing purpose
-    status_t injectEvent(const vehicle_prop_value_t& value);
-
-    // starting / stopping mocking not added yet.
-    status_t startMocking(const sp<IVehicleNetworkHalMock>& mock);
-    void stopMocking(const sp<IVehicleNetworkHalMock>& mock);
-
-    // only for testing
-    status_t injectHalError(int32_t errorCode, int32_t property, int32_t operation);
-
-    status_t startErrorListening();
-    void stopErrorListening();
-
-    //IBinder::DeathRecipient, not for client
-    void binderDied(const wp<IBinder>& who);
-    // BnVehicleNetworkListener, not for client
-    void onEvents(sp<VehiclePropValueListHolder>& events);
-    void onHalError(int32_t errorCode, int32_t property, int32_t operation);
-    void onHalRestart(bool inMocking);
-    void onPropertySet(const vehicle_prop_value_t& value);
-
-private:
-    VehicleNetwork(sp<IVehicleNetwork>& vehicleNetwork, sp<VehicleNetworkListener> &listener);
-    // RefBase
-    virtual void onFirstRef();
-    sp<IVehicleNetwork> getService();
-    sp<VehicleNetworkEventMessageHandler> getEventHandler();
-
-private:
-    sp<IVehicleNetwork> mService;
-    sp<VehicleNetworkListener> mClientListener;
-    Mutex mLock;
-    sp<HandlerThread> mHandlerThread;
-    sp<VehicleNetworkEventMessageHandler> mEventHandler;
-};
-
-// ----------------------------------------------------------------------------
-
-}; // namespace android
-
-#endif /* ANDROID_VEHICLE_NETWORK_H */
-
diff --git a/libvehiclenetwork/include/VehicleNetworkDataTypes.h b/libvehiclenetwork/include/VehicleNetworkDataTypes.h
deleted file mode 100644
index 101424b..0000000
--- a/libvehiclenetwork/include/VehicleNetworkDataTypes.h
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_NETWORK_DATA_TYPES_H
-#define ANDROID_VEHICLE_NETWORK_DATA_TYPES_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <assert.h>
-
-#include <memory>
-
-#include <binder/Parcel.h>
-#include <hardware/vehicle.h>
-
-#include <utils/List.h>
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-
-//#define LOG_MEMORY
-
-#ifdef LOG_MEMORY
-#include <utils/CallStack.h>
-#endif
-/**
- * Define this macro to make the process crash when memory alloc fails.
- * Enabling this can be useful to track memory leak. When this macro is not define,
- * memory alloc failure will lead into returning from the current function
- * with behavior like returning NO_MEMORY error.
- */
-#define ASSERT_ON_NO_MEMORY
-#ifdef ASSERT_ON_NO_MEMORY
-#define ASSERT_OR_HANDLE_NO_MEMORY(ptr, action) assert((ptr) != NULL)
-#else
-#define ASSERT_OR_HANDLE_NO_MEMORY(ptr, action) if ((ptr) == NULL) { action; }
-#endif
-
-#define ASSERT_ALWAYS_ON_NO_MEMORY(ptr) assert((ptr) != NULL)
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-/**
- * Collection of help utilities for vehicle_prop_config_t
- */
-class VehiclePropertiesUtil {
-public:
-    /**
-     * Helper utility to delete vehicle_prop_config_t manually. Client does not need to do this for
-     * VehiclePropertiesHolder. This is for the case where client creates vehicle_prop_config_t
-     * directly.
-     */
-    static void deleteMembers(vehicle_prop_config_t* config) {
-        if (config->config_string.data != NULL && config->config_string.len > 0){
-            delete[] config->config_string.data;
-#ifdef LOG_MEMORY
-                ALOGE("deleteConfigString %p, l:%d",config->config_string.data,
-                        config->config_string.len);
-#endif
-        }
-        switch (config->prop) {
-            case VEHICLE_VALUE_TYPE_ZONED_INT32:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4: {
-                delete[] config->int32_max_values;
-                delete[] config->int32_min_values;
-            } break;
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4: {
-                delete[] config->float_max_values;
-                delete[] config->float_min_values;
-            } break;
-        }
-    };
-
-    static bool isTheSame(const vehicle_prop_config_t& l, const vehicle_prop_config_t& r) {
-        if (l.prop != r.prop) {
-            return false;
-        }
-        if (l.access != r.access) {
-            return false;
-        }
-        if (l.change_mode != r.change_mode) {
-            return false;
-        }
-        if (l.value_type != r.value_type) {
-            return false;
-        }
-        if (l.permission_model != r.permission_model) {
-            return false;
-        }
-        if (l.config_flags != r.config_flags) {
-            return false;
-        }
-        if (l.float_min_value != r.float_min_value) {
-            return false;
-        }
-        if (l.float_max_value != r.float_max_value) {
-            return false;
-        }
-        if (l.min_sample_rate != r.min_sample_rate) {
-            return false;
-        }
-        if (l.max_sample_rate != r.max_sample_rate) {
-            return false;
-        }
-        return true;
-    }
-};
-// ----------------------------------------------------------------------------
-
-/**
- * Ref counted container for array of vehicle_prop_config_t.
- */
-class VehiclePropertiesHolder : public virtual RefBase {
-public:
-
-    VehiclePropertiesHolder(bool deleteConfigsInDestructor = true)
-        : mDeleteConfigsInDestructor(deleteConfigsInDestructor) {
-#ifdef LOG_MEMORY
-        ALOGE("VehiclePropertiesHolder, this %p", this);
-#endif
-    };
-
-    virtual ~VehiclePropertiesHolder() {
-#ifdef LOG_MEMORY
-        ALOGE("~VehiclePropertiesHolder, this %p, deleteConfig:%d", this,
-                mDeleteConfigsInDestructor);
-#endif
-        if (!mDeleteConfigsInDestructor) {
-            return; // should not delete members
-        }
-        for (auto& e : mList) {
-            vehicle_prop_config_t* eDelete = const_cast<vehicle_prop_config_t*>(e);
-            VehiclePropertiesUtil::deleteMembers(eDelete);
-            delete eDelete;
-        }
-        mList.clear();
-    };
-
-    List<vehicle_prop_config_t const *>& getList() {
-        return mList;
-    };
-
-private:
-    List<vehicle_prop_config_t const *> mList;
-    bool mDeleteConfigsInDestructor;
-};
-
-// ----------------------------------------------------------------------------
-
-/**
- * Collection of help utilities for vehicle_prop_value_t
- */
-class VehiclePropValueUtil {
-public:
-    /**
-     * This one only deletes pointer member, so that vehicle_prop_value_t can be stack variable.
-     */
-    static void deleteMembers(vehicle_prop_value_t* v) {
-        if (v == NULL) {
-            return;
-        }
-        switch (v->value_type) {
-            case VEHICLE_VALUE_TYPE_BYTES:
-            case VEHICLE_VALUE_TYPE_STRING: {
-#ifdef LOG_MEMORY
-                ALOGE("deleteValueArray %p, l:%d",v->value.str_value.data,
-                        v->value.str_value.len);
-#endif
-                delete[] v->value.str_value.data;
-                v->value.str_value.data = NULL;
-            } break;
-        }
-    };
-
-    static status_t copyVehiclePropValue(vehicle_prop_value_t* dest,
-            const vehicle_prop_value_t& src, bool deleteOldData = false) {
-        switch (src.value_type) {
-        case VEHICLE_VALUE_TYPE_BYTES:
-        case VEHICLE_VALUE_TYPE_STRING: {
-            if (deleteOldData && dest->value.str_value.data != NULL &&
-                    dest->value.str_value.len > 0) {
-                delete[] dest->value.str_value.data;
-#ifdef LOG_MEMORY
-                ALOGE("deleteValueArray %p, l:%d", dest->value.str_value.data,
-                        dest->value.str_value.len);
-#endif
-            }
-            memcpy(dest, &src, sizeof(vehicle_prop_value_t));
-            if (dest->value.str_value.len > 0) {
-                dest->value.str_value.data = new uint8_t[dest->value.str_value.len];
-                ASSERT_OR_HANDLE_NO_MEMORY(dest->value.str_value.data, return NO_MEMORY);
-#ifdef LOG_MEMORY
-                ALOGE("allocValueArray %p, l:%d", dest->value.str_value.data,
-                        dest->value.str_value.len);
-                /* enable to dump stack
-                if (dest->value.str_value.len > 10000) {
-                    CallStack stack;
-                    stack.update();
-                    stack.log(LOG_TAG, ANDROID_LOG_ERROR);
-                }*/
-#endif
-                memcpy(dest->value.str_value.data, src.value.str_value.data,
-                        dest->value.str_value.len);
-            } else {
-                dest->value.str_value.data = NULL;
-            }
-        } break;
-        default: {
-            memcpy(dest, &src, sizeof(vehicle_prop_value_t));
-        } break;
-        }
-        return NO_ERROR;
-    }
-
-    /**
-     * Create a deep copy of vehicle_prop_value_t.
-     */
-    static vehicle_prop_value_t* allocVehiclePropValue(const vehicle_prop_value_t& v) {
-        std::unique_ptr<vehicle_prop_value_t> copy(new vehicle_prop_value_t());
-        ASSERT_OR_HANDLE_NO_MEMORY(copy.get(), return NO_MEMORY);
-        status_t r = copyVehiclePropValue(copy.get(), v);
-        if (r != NO_ERROR) {
-            return NULL;
-        }
-#ifdef LOG_MEMORY
-        ALOGE("allocVehiclePropValue, %p", copy.get());
-#endif
-        return copy.release();
-    };
-
-    static void deleteVehiclePropValue(vehicle_prop_value_t* v) {
-#ifdef LOG_MEMORY
-        ALOGE("deleteVehiclePropValue, %p", v);
-#endif
-        deleteMembers(v);
-        delete v;
-    }
-};
-
-// ----------------------------------------------------------------------------
-
-/**
- * This is utility class to have local vehicle_prop_value_t to hold data temporarily,
- * and to release all data without memory leak.
- * Usage is:
- *     ScopedVehiclePropValue value;
- *     // use value.value
- *     Then things allocated to value.value will be all cleaned up properly.
- */
-class ScopedVehiclePropValue {
-public:
-    vehicle_prop_value_t value;
-
-    ScopedVehiclePropValue() {
-        memset(&value, 0, sizeof(value));
-#ifdef LOG_MEMORY
-        ALOGE("ScopedVehiclePropValue, %p", this);
-#endif
-    };
-
-    virtual ~ScopedVehiclePropValue() {
-        VehiclePropValueUtil::deleteMembers(&value);
-#ifdef LOG_MEMORY
-        ALOGE("~ScopedVehiclePropValue, %p", this);
-#endif
-    };
-};
-
-// ----------------------------------------------------------------------------
-/**
- * Reference counted container of List holding vehicle_prop_value_t*.
- */
-class VehiclePropValueListHolder : public virtual RefBase {
-public:
-    VehiclePropValueListHolder(List<vehicle_prop_value_t* > * list, bool deleteInDestructor = true)
-      : mList(list),
-        mDeleteInDestructor(deleteInDestructor) {
-#ifdef LOG_MEMORY
-        ALOGE("VehiclePropValueListHolder, %p", this);
-#endif
-    };
-
-    List<vehicle_prop_value_t*>& getList() {
-        return *mList;
-    };
-
-    virtual ~VehiclePropValueListHolder() {
-#ifdef LOG_MEMORY
-            ALOGE("~VehiclePropValueListHolder, %p, deleteList:%d", this, mDeleteInDestructor);
-#endif
-        if (mDeleteInDestructor && mList != NULL) {
-            for (auto pv : *mList) {
-                VehiclePropValueUtil::deleteMembers(pv);
-                delete pv;
-            }
-            delete mList;
-        }
-    };
-
-private:
-    List<vehicle_prop_value_t*>* mList;
-    bool mDeleteInDestructor;
-};
-
-// ----------------------------------------------------------------------------
-class VehicleHalError {
-public:
-    int32_t errorCode;
-    int32_t property;
-    int32_t operation;
-    VehicleHalError(int32_t aErrorCode, int32_t aProperty, int32_t aOperation) :
-        errorCode(aErrorCode),
-        property(aProperty),
-        operation(aOperation) {};
-};
-}; //namespace android
-
-#endif /* ANDROID_VEHICLE_NETWORK_DATA_TYPES_H*/
diff --git a/libvehiclenetwork/include/vehicle-internal.h b/libvehiclenetwork/include/vehicle-internal.h
deleted file mode 100644
index 92028a0..0000000
--- a/libvehiclenetwork/include/vehicle-internal.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_INTERNAL_H
-#define ANDROID_VEHICLE_INTERNAL_H
-
-#include <hardware/vehicle.h>
-
-__BEGIN_DECLS
-
-/**
- * Define all internal properties used in VNS. This is not shared with vehicle HAL, but
- * used for internal synchronization / testing purpose.
- */
-
-/**
- * Represents state of audio stream. Audio HAL should set this when a steam is starting or ending.
- * Actual streaming of data should be done only after getting focus for the given stream from
- * car audio module. Focus can be already granted when stream is started. Focus state can be
- * monitored by monitoring VEHICLE_PROPERTY_AUDIO_FOCUS. If car does not support
- * VEHICLE_PROPERTY_AUDIO_FOCUS, there is no need to monitor focus as focus is assumed to be
- * granted always.
- * Data has the following format:
- *   int32_array[0] : vehicle_audio_stream_state
- *   int32_array[1] : stream number
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
- * @data_member int32_array
- */
-#define VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE      (0x74000000)
-
-enum vehicle_audio_stream_state {
-    VEHICLE_AUDIO_STREAM_STATE_STOPPED = 0,
-    VEHICLE_AUDIO_STREAM_STATE_STARTED = 1,
-};
-
-enum vehicle_audio_stream_state_index {
-    VEHICLE_AUDIO_STREAM_STATE_INDEX_STATE = 0,
-    VEHICLE_AUDIO_STREAM_STATE_INDEX_STREAM = 1,
-};
-
-__END_DECLS
-
-#endif /* ANDROID_VEHICLE_INTERNAL_H */
diff --git a/libvehiclenetwork/libvehiclenetwork-audio-helper/Android.mk b/libvehiclenetwork/libvehiclenetwork-audio-helper/Android.mk
index a8da42c..889eec8 100644
--- a/libvehiclenetwork/libvehiclenetwork-audio-helper/Android.mk
+++ b/libvehiclenetwork/libvehiclenetwork-audio-helper/Android.mk
@@ -15,6 +15,8 @@
 #
 LOCAL_PATH:= $(call my-dir)
 
+ifeq ($(VN_AUDIO_HELPER_BLAH), true)
+
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
@@ -35,3 +37,5 @@
 LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_STATIC_LIBRARY)
+
+endif  #ifeq ($(VN_AUDIO_HELPER_BLAH), true)
diff --git a/libvehiclenetwork/native/Android.mk b/libvehiclenetwork/native/Android.mk
deleted file mode 100644
index 59242cf..0000000
--- a/libvehiclenetwork/native/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2015 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_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
-    find . -name "*.cpp" -and -not -name ".*"))
-
-LOCAL_C_INCLUDES += \
-    frameworks/base/include \
-    packages/services/Car/libvehiclenetwork/include
-
-LOCAL_SHARED_LIBRARIES := \
-    liblog \
-    libutils \
-    libhardware \
-    libbinder \
-    libprotobuf-cpp-lite
-
-LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libbinder
-
-LOCAL_STATIC_LIBRARIES := \
-    libvehiclenetworkproto-native
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-LOCAL_MODULE := libvehiclenetwork-native
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS += -Werror
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/libvehiclenetwork/native/BinderUtil.h b/libvehiclenetwork/native/BinderUtil.h
deleted file mode 100644
index ccae78e..0000000
--- a/libvehiclenetwork/native/BinderUtil.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_NETWORK_BINDER_UTIL_H
-#define ANDROID_VEHICLE_NETWORK_BINDER_UTIL_H
-
-#include <stdint.h>
-#include <binder/Parcel.h>
-
-namespace android {
-
-class BinderUtil {
-public:
-    static void fillNoResultReply(Parcel* reply) {
-        reply->writeNoException();
-    }
-
-    static void fillObjectResultReply(Parcel* reply, bool isValid) {
-        reply->writeNoException();
-        reply->writeInt32(isValid ? 1 : 0);
-    }
-};
-
-}; // namespace android
-#endif /* ANDROID_VEHICLE_NETWORK_BINDER_UTIL_H */
diff --git a/libvehiclenetwork/native/HandlerThread.cpp b/libvehiclenetwork/native/HandlerThread.cpp
deleted file mode 100644
index 2e15071..0000000
--- a/libvehiclenetwork/native/HandlerThread.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2015 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 "HandlerThread.h"
-
-namespace android {
-
-HandlerThread::HandlerThread()
-    : mShouldQuit(false) {
-
-}
-
-HandlerThread::~HandlerThread() {
-    quit();
-}
-
-sp<Looper> HandlerThread::getLooper() {
-    Mutex::Autolock autoLock(mLock);
-    if (mLooper.get() == 0) {
-        mLooperWait.wait(mLock);
-    }
-    return mLooper;
-}
-
-status_t HandlerThread::start(const char* name, int32_t priority, size_t stack) {
-    return run(name, priority, stack);
-}
-
-void HandlerThread::quit() {
-    if (!isRunning()) {
-        return;
-    }
-    sp<Looper> looper = getLooper();
-    mLock.lock();
-    mShouldQuit = true;
-    mLock.unlock();
-    looper->wake();
-    requestExitAndWait();
-}
-
-bool HandlerThread::threadLoop() {
-    mLock.lock();
-    mLooper = Looper::prepare(0);
-    mLooperWait.broadcast();
-    mLock.unlock();
-    while (true) {
-        do {
-            Mutex::Autolock autoLock(mLock);
-            if (mShouldQuit) {
-                return false;
-            }
-        } while (false);
-        mLooper->pollOnce(-1);
-    }
-    return false;
-}
-
-
-};
diff --git a/libvehiclenetwork/native/IVehicleNetwork.cpp b/libvehiclenetwork/native/IVehicleNetwork.cpp
deleted file mode 100644
index a100b1c..0000000
--- a/libvehiclenetwork/native/IVehicleNetwork.cpp
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetwork"
-
-#include <memory>
-#include <string.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/Status.h>
-
-#include <utils/Log.h>
-
-#include <IVehicleNetwork.h>
-#include <VehicleNetworkProto.pb.h>
-
-#include "BinderUtil.h"
-#include "VehicleNetworkProtoUtil.h"
-
-namespace android {
-
-enum {
-    LIST_PROPERTIES = IBinder::FIRST_CALL_TRANSACTION,
-    SET_PROPERTY,
-    GET_PROPERTY,
-    SUBSCRIBE,
-    UNSUBSCRIBE,
-    INJECT_EVENT,
-    START_MOCKING,
-    STOP_MOCKING,
-    INJECT_HAL_ERROR,
-    START_ERROR_LISTENING,
-    STOP_ERROR_LISTENING,
-    START_HAL_RESTART_MONITORING,
-    STOP_HAL_RESTART_MONITORING
-};
-
-// ----------------------------------------------------------------------------
-
-const char IVehicleNetwork::SERVICE_NAME[] = "com.android.car.vehiclenetwork.IVehicleNetwork";
-
-// ----------------------------------------------------------------------------
-
-class BpVehicleNetwork : public BpInterface<IVehicleNetwork> {
-public:
-    explicit BpVehicleNetwork(const sp<IBinder> & impl)
-        : BpInterface<IVehicleNetwork>(impl) {
-    }
-
-    virtual sp<VehiclePropertiesHolder> listProperties(int32_t property) {
-        sp<VehiclePropertiesHolder> holder;
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeInt32(property);
-        status_t status = remote()->transact(LIST_PROPERTIES, data, &reply);
-        if (status == NO_ERROR) {
-            reply.readExceptionCode(); // for compatibility with java
-            if (reply.readInt32() == 0) { // no result
-                return holder;
-            }
-            ReadableBlobHolder blob(new Parcel::ReadableBlob());
-            if (blob.blob == NULL) {
-                ALOGE("listProperties, no memory");
-                return holder;
-            }
-            int32_t size = reply.readInt32();
-            if (size < 0) {
-                ALOGE("listProperties, bad blob size %d", size);
-                return holder;
-            }
-            status = reply.readBlob(size, blob.blob);
-            if (status != NO_ERROR) {
-                ALOGE("listProperties, cannot read blob %d", status);
-                return holder;
-            }
-            std::unique_ptr<VehiclePropConfigs> configs(new VehiclePropConfigs());
-            if (configs.get() == NULL) {
-                return holder;
-            }
-            if(!configs->ParseFromArray(blob.blob->data(), size)) {
-                ALOGE("listProperties, cannot parse reply");
-                return holder;
-            }
-            holder = new VehiclePropertiesHolder();
-            ASSERT_OR_HANDLE_NO_MEMORY(holder.get(), return);
-            status = VehicleNetworkProtoUtil::fromVehiclePropConfigs(*configs.get(),
-                    holder->getList());
-            if (status != NO_ERROR) {
-                ALOGE("listProperties, cannot convert VehiclePropConfigs %d", status);
-                return holder;
-            }
-
-        }
-        return holder;
-    }
-
-    virtual status_t setProperty(const vehicle_prop_value_t& value) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        status_t status = VehiclePropValueBinderUtil::writeToParcel(data, value);
-        if (status != NO_ERROR) {
-            return status;
-        }
-        status = remote()->transact(SET_PROPERTY, data, &reply);
-        if (status == NO_ERROR) {
-            int32_t exceptionCode = reply.readExceptionCode();
-            if (exceptionCode != NO_ERROR) {
-                if (exceptionCode == binder::Status::EX_SERVICE_SPECIFIC) {
-                    return -EAGAIN;
-                } else if (exceptionCode == binder::Status::EX_ILLEGAL_STATE) {
-                    return -ESHUTDOWN;
-                }
-                return exceptionCode;
-            }
-        }
-        return status;
-    }
-
-    virtual status_t getProperty(vehicle_prop_value_t* value) {
-        Parcel data, reply;
-        if (value == NULL) {
-            return BAD_VALUE;
-        }
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        status_t status = VehiclePropValueBinderUtil::writeToParcel(data, *value);
-        if (status != NO_ERROR) {
-            ALOGE("getProperty, cannot write");
-            return status;
-        }
-        status = remote()->transact(GET_PROPERTY, data, &reply);
-        if (status == NO_ERROR) {
-            int32_t exceptionCode = reply.readExceptionCode();
-            if (exceptionCode != NO_ERROR) {
-                if (exceptionCode == binder::Status::EX_SERVICE_SPECIFIC) {
-                    return -EAGAIN;
-                } else if (exceptionCode == binder::Status::EX_ILLEGAL_STATE) {
-                    return -ESHUTDOWN;
-                }
-                return exceptionCode;
-            }
-            status = VehiclePropValueBinderUtil::readFromParcel(reply, value);
-        }
-        return status;
-    }
-
-    virtual status_t subscribe(const sp<IVehicleNetworkListener> &listener, int32_t property,
-                float sampleRate, int32_t zones, int32_t flags) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        data.writeInt32(property);
-        data.writeFloat(sampleRate);
-        data.writeInt32(zones);
-        data.writeInt32(flags);
-        status_t status = remote()->transact(SUBSCRIBE, data, &reply);
-        return status;
-    }
-
-    virtual void unsubscribe(const sp<IVehicleNetworkListener> &listener, int32_t property) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        data.writeInt32(property);
-        status_t status = remote()->transact(UNSUBSCRIBE, data, &reply);
-        if (status != NO_ERROR) {
-            ALOGI("unsubscribing property %d failed %d", property, status);
-        }
-    }
-
-    virtual status_t injectEvent(const vehicle_prop_value_t& value) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeInt32(1); // 0 means no value. For compatibility with aidl based code.
-        std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-        ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-        VehicleNetworkProtoUtil::toVehiclePropValue(value, *v.get());
-        int size = v->ByteSize();
-        WritableBlobHolder blob(new Parcel::WritableBlob());
-        ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-        data.writeInt32(size);
-        data.writeBlob(size, false, blob.blob);
-        v->SerializeToArray(blob.blob->data(), size);
-        status_t status = remote()->transact(INJECT_EVENT, data, &reply);
-        return status;
-    }
-
-    virtual status_t startMocking(const sp<IVehicleNetworkHalMock>& mock) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(mock));
-        status_t status = remote()->transact(START_MOCKING, data, &reply);
-        return status;
-    }
-
-    virtual void stopMocking(const sp<IVehicleNetworkHalMock>& mock) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(mock));
-        status_t status = remote()->transact(STOP_MOCKING, data, &reply);
-        if (status != NO_ERROR) {
-            ALOGI("stop mocking failed %d", status);
-        }
-    }
-
-    status_t injectHalError(int32_t errorCode, int32_t property, int32_t operation) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeInt32(errorCode);
-        data.writeInt32(property);
-        data.writeInt32(operation);
-        status_t status = remote()->transact(INJECT_HAL_ERROR, data, &reply);
-        return status;
-    }
-
-    virtual status_t startErrorListening(const sp<IVehicleNetworkListener> &listener) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        status_t status = remote()->transact(START_ERROR_LISTENING, data, &reply);
-        return status;
-    }
-
-    virtual void stopErrorListening(const sp<IVehicleNetworkListener> &listener) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        status_t status = remote()->transact(STOP_ERROR_LISTENING, data, &reply);
-        if (status != NO_ERROR) {
-            ALOGI("stopErrorListening %d", status);
-        }
-    }
-
-    virtual status_t startHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        status_t status = remote()->transact(START_HAL_RESTART_MONITORING, data, &reply);
-        return status;
-    }
-
-    virtual void stopHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetwork::getInterfaceDescriptor());
-        data.writeStrongBinder(IInterface::asBinder(listener));
-        status_t status = remote()->transact(STOP_HAL_RESTART_MONITORING, data, &reply);
-        if (status != NO_ERROR) {
-            ALOGI("stopHalRestartMonitoring %d", status);
-        }
-    }
-};
-
-IMPLEMENT_META_INTERFACE(VehicleNetwork, IVehicleNetwork::SERVICE_NAME);
-
-// ----------------------------------------------------------------------
-
-status_t BnVehicleNetwork::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
-        uint32_t flags) {
-    status_t r;
-    switch (code) {
-        case LIST_PROPERTIES: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            if (!isOperationAllowed(0, false)) {
-                return PERMISSION_DENIED;
-            }
-            int32_t property = data.readInt32();
-            sp<VehiclePropertiesHolder> holder = listProperties(property);
-            if (holder.get() == NULL) { // given property not found
-                BinderUtil::fillObjectResultReply(reply, false /* isValid */);
-                return NO_ERROR;
-            }
-            std::unique_ptr<VehiclePropConfigs> configs(new VehiclePropConfigs());
-            ASSERT_OR_HANDLE_NO_MEMORY(configs.get(), return NO_MEMORY);
-            VehicleNetworkProtoUtil::toVehiclePropConfigs(holder->getList(), *configs.get());
-            int size = configs->ByteSize();
-            WritableBlobHolder blob(new Parcel::WritableBlob());
-            ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-            BinderUtil::fillObjectResultReply(reply, true);
-            reply->writeInt32(size);
-            reply->writeBlob(size, false, blob.blob);
-            configs->SerializeToArray(blob.blob->data(), size);
-            return NO_ERROR;
-        } break;
-        case SET_PROPERTY: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            ScopedVehiclePropValue value;
-            r = VehiclePropValueBinderUtil::readFromParcel(data, &value.value,
-                    false /* deleteMembers */);
-            if (r != NO_ERROR) {
-                return r;
-            }
-            if (!isOperationAllowed(value.value.prop, true)) {
-                return PERMISSION_DENIED;
-            }
-            r = setProperty(value.value);
-            if (r == NO_ERROR) {
-                reply->writeNoException();
-            } else if (r == -EAGAIN) {
-                // this should be handled specially to throw ServiceSpecificException in java.
-                reply->writeInt32(binder::Status::EX_SERVICE_SPECIFIC);
-                return NO_ERROR;
-            } else if (r == -ESHUTDOWN) {
-                // this should be handled specially to throw IllegalStateException in java.
-                reply->writeInt32(binder::Status::EX_ILLEGAL_STATE);
-                return NO_ERROR;
-            }
-            return r;
-        } break;
-        case GET_PROPERTY: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            vehicle_prop_value_t value;
-            memset(&value, 0, sizeof(value));
-            r = VehiclePropValueBinderUtil::readFromParcel(data, &value,
-                    false /* deleteMembers */, true /*canIgnoreNoData*/);
-            if (r != NO_ERROR) {
-                ALOGE("getProperty cannot read %d", r);
-                return r;
-            }
-            if (!isOperationAllowed(value.prop, false)) {
-                return PERMISSION_DENIED;
-            }
-            r = getProperty(&value);
-            if (r == NO_ERROR) {
-                // If int32 or float value is out of range, throw an exception:
-                switch (value.value_type) {
-                case VEHICLE_VALUE_TYPE_INT32:
-                case VEHICLE_VALUE_TYPE_ZONED_INT32:
-                    if (value.value.int32_value == VEHICLE_INT_OUT_OF_RANGE_OFF) {
-                        // this should be handled specially to throw IllegalStateException in java.
-                        reply->writeInt32(binder::Status::EX_ILLEGAL_STATE);
-                        return NO_ERROR;
-                    }
-                    break;
-                case VEHICLE_VALUE_TYPE_FLOAT:
-                case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-                    if (value.value.float_value == VEHICLE_FLOAT_OUT_OF_RANGE_OFF) {
-                        // this should be handled specially to throw IllegalStateException in java.
-                        reply->writeInt32(binder::Status::EX_ILLEGAL_STATE);
-                        return NO_ERROR;
-                    }
-                    break;
-                }
-                reply->writeNoException();
-                r = VehiclePropValueBinderUtil::writeToParcel(*reply, value);
-                releaseMemoryFromGet(&value);
-            } else if (r == -EAGAIN) {
-                // this should be handled specially to throw ServiceSpecificException in java.
-                reply->writeInt32(binder::Status::EX_SERVICE_SPECIFIC);
-                return NO_ERROR;
-            }
-            return r;
-        } break;
-        case SUBSCRIBE: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            int32_t property = data.readInt32();
-            if (!isOperationAllowed(property, false)) {
-                return PERMISSION_DENIED;
-            }
-            float sampleRate = data.readFloat();
-            int32_t zones = data.readInt32();
-            int32_t flags = data.readInt32();
-            r = subscribe(listener, property, sampleRate, zones, flags);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case UNSUBSCRIBE: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            int32_t property = data.readInt32();
-            if (!isOperationAllowed(property, false)) {
-                return PERMISSION_DENIED;
-            }
-            unsubscribe(listener, property);
-            BinderUtil::fillNoResultReply(reply);
-            return NO_ERROR;
-        } break;
-        case INJECT_EVENT: {
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            if (data.readInt32() == 0) { // java side allows passing null with this.
-                return BAD_VALUE;
-            }
-            if (!isOperationAllowed(0, true)) {
-                return PERMISSION_DENIED;
-            }
-            ScopedVehiclePropValue value;
-            ReadableBlobHolder blob(new Parcel::ReadableBlob());
-            ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-            int32_t size = data.readInt32();
-            if (size < 0) {
-                ALOGE("injectEvent:service, bad blob size %d", size);
-                return BAD_VALUE;
-            }
-            r = data.readBlob(size, blob.blob);
-            if (r != NO_ERROR) {
-                ALOGE("injectEvent:service, cannot read blob");
-                return r;
-            }
-            std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-            ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-            if (!v->ParseFromArray(blob.blob->data(), size)) {
-                ALOGE("injectEvent:service, cannot parse data");
-                return BAD_VALUE;
-            }
-            r = VehicleNetworkProtoUtil::fromVehiclePropValue(*v.get(), value.value);
-            if (r != NO_ERROR) {
-                ALOGE("injectEvent:service, cannot convert data");
-                return BAD_VALUE;
-            }
-            r = injectEvent(value.value);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case START_MOCKING: {
-            if (!isOperationAllowed(0, true)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkHalMock> mock =
-                    interface_cast<IVehicleNetworkHalMock>(data.readStrongBinder());
-            r = startMocking(mock);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case STOP_MOCKING: {
-            if (!isOperationAllowed(0, true)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkHalMock> mock =
-                    interface_cast<IVehicleNetworkHalMock>(data.readStrongBinder());
-            stopMocking(mock);
-            BinderUtil::fillNoResultReply(reply);
-            return NO_ERROR;
-        } break;
-        case INJECT_HAL_ERROR: {
-            if (!isOperationAllowed(0, true)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            int32_t errorCode = data.readInt32();
-            int32_t property = data.readInt32();
-            int32_t operation = data.readInt32();
-            r = injectHalError(errorCode, property, operation);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case START_ERROR_LISTENING: {
-            if (!isOperationAllowed(0, false)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            r = startErrorListening(listener);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case STOP_ERROR_LISTENING: {
-            if (!isOperationAllowed(0, false)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            stopErrorListening(listener);
-            BinderUtil::fillNoResultReply(reply);
-            return NO_ERROR;
-        } break;
-        case START_HAL_RESTART_MONITORING: {
-            if (!isOperationAllowed(0, false)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            r = startHalRestartMonitoring(listener);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case STOP_HAL_RESTART_MONITORING: {
-            if (!isOperationAllowed(0, false)) {
-                return PERMISSION_DENIED;
-            }
-            CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            sp<IVehicleNetworkListener> listener =
-                    interface_cast<IVehicleNetworkListener>(data.readStrongBinder());
-            stopHalRestartMonitoring(listener);
-            BinderUtil::fillNoResultReply(reply);
-            return NO_ERROR;
-        } break;
-        default:
-            return BBinder::onTransact(code, data, reply, flags);
-    }
-}
-
-}; // namespace android
diff --git a/libvehiclenetwork/native/IVehicleNetworkHalMock.cpp b/libvehiclenetwork/native/IVehicleNetworkHalMock.cpp
deleted file mode 100644
index d7929b4..0000000
--- a/libvehiclenetwork/native/IVehicleNetworkHalMock.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetwork"
-
-#include <memory>
-
-#include <binder/IPCThreadState.h>
-#include <private/android_filesystem_config.h>
-
-#include <utils/Log.h>
-
-#include <IVehicleNetwork.h>
-#include <IVehicleNetworkHalMock.h>
-#include <VehicleNetworkProto.pb.h>
-
-#include "BinderUtil.h"
-#include "VehicleNetworkProtoUtil.h"
-
-namespace android {
-
-enum {
-    ON_LIST_PROPERTIES = IBinder::FIRST_CALL_TRANSACTION,
-    ON_PROPERTY_SET,
-    ON_PROPERTY_GET,
-    ON_SUBSCRIBE,
-    ON_UNSUBSCRIBE,
-};
-
-// ----------------------------------------------------------------------------
-
-const char IVehicleNetworkHalMock::SERVICE_NAME[] =
-        "com.android.car.vehiclenetwork.IVehicleNetworkHalMock";
-
-// ----------------------------------------------------------------------------
-
-class BpVehicleNetworkHalMock : public BpInterface<IVehicleNetworkHalMock> {
-public:
-    explicit BpVehicleNetworkHalMock(const sp<IBinder> & impl)
-        : BpInterface<IVehicleNetworkHalMock>(impl) {
-    }
-
-    virtual sp<VehiclePropertiesHolder> onListProperties() {
-        sp<VehiclePropertiesHolder> holder;
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkHalMock::getInterfaceDescriptor());
-        status_t status = remote()->transact(ON_LIST_PROPERTIES, data, &reply);
-        if (status == NO_ERROR) {
-            reply.readExceptionCode(); // for compatibility with java
-            if (reply.readInt32() == 0) { // no result
-                return holder;
-            }
-            ReadableBlobHolder blob(new Parcel::ReadableBlob());
-            if (blob.blob == NULL) {
-                ALOGE("listProperties, no memory");
-                return holder;
-            }
-            int32_t size = reply.readInt32();
-            if (size < 0) {
-                ALOGE("listProperties, bad blob size %d", size);
-                return holder;
-            }
-            status = reply.readBlob(size, blob.blob);
-            if (status != NO_ERROR) {
-                ALOGE("listProperties, cannot read blob %d", status);
-                return holder;
-            }
-            std::unique_ptr<VehiclePropConfigs> configs(new VehiclePropConfigs());
-            if (configs.get() == NULL) {
-                return holder;
-            }
-            if(!configs->ParseFromArray(blob.blob->data(), size)) {
-                ALOGE("listProperties, cannot parse reply");
-                return holder;
-            }
-            holder = new VehiclePropertiesHolder();
-            ASSERT_OR_HANDLE_NO_MEMORY(holder.get(), return);
-            status = VehicleNetworkProtoUtil::fromVehiclePropConfigs(*configs.get(),
-                    holder->getList());
-            if (status != NO_ERROR) {
-                ALOGE("listProperties, cannot convert VehiclePropConfigs %d", status);
-                return holder;
-            }
-
-        }
-        return holder;
-    }
-
-    virtual status_t onPropertySet(const vehicle_prop_value_t& value) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkHalMock::getInterfaceDescriptor());
-        status_t status = VehiclePropValueBinderUtil::writeToParcel(data, value);
-        if (status != NO_ERROR) {
-            return status;
-        }
-        status = remote()->transact(ON_PROPERTY_SET, data, &reply);
-        return status;
-    }
-
-    virtual status_t onPropertyGet(vehicle_prop_value_t* value) {
-        if (value == NULL) {
-            return BAD_VALUE;
-        }
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkHalMock::getInterfaceDescriptor());
-        status_t status = VehiclePropValueBinderUtil::writeToParcel(data, *value);
-        if (status != NO_ERROR) {
-            return status;
-        }
-        status = remote()->transact(ON_PROPERTY_GET, data, &reply);
-        if (status == NO_ERROR) {
-            reply.readExceptionCode(); // for compatibility with java
-            status = VehiclePropValueBinderUtil::readFromParcel(reply, value);
-        }
-        return status;
-    }
-
-    virtual status_t onPropertySubscribe(int32_t property, float sampleRate, int32_t zones) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkHalMock::getInterfaceDescriptor());
-        data.writeInt32(property);
-        data.writeFloat(sampleRate);
-        data.writeInt32(zones);
-        status_t status = remote()->transact(ON_SUBSCRIBE, data, &reply);
-        return status;
-    }
-
-    virtual void onPropertyUnsubscribe(int32_t property) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkHalMock::getInterfaceDescriptor());
-        data.writeInt32(property);
-        status_t status = remote()->transact(ON_UNSUBSCRIBE, data, &reply);
-        if (status != NO_ERROR) {
-            ALOGI("onPropertyUnsubscribe property %d failed %d", property, status);
-        }
-    }
-};
-
-IMPLEMENT_META_INTERFACE(VehicleNetworkHalMock, IVehicleNetworkHalMock::SERVICE_NAME);
-
-// ----------------------------------------------------------------------
-
-static bool isSystemUser() {
-    uid_t uid =  IPCThreadState::self()->getCallingUid();
-    switch (uid) {
-        // This list will be expanded. Only those UIDs are allowed to access vehicle network
-        // for now. There can be per property based UID check built-in as well.
-        case AID_ROOT:
-        case AID_SYSTEM:
-        case AID_AUDIO: {
-            return true;
-        } break;
-        default: {
-            ALOGE("non-system user tried access, uid %d", uid);
-        } break;
-    }
-    return false;
-}
-
-status_t BnVehicleNetworkHalMock::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
-        uint32_t flags) {
-    if (!isSystemUser()) {
-        return PERMISSION_DENIED;
-    }
-    status_t r;
-    switch (code) {
-        case ON_LIST_PROPERTIES: {
-            CHECK_INTERFACE(IVehicleNetworkHalMock, data, reply);
-            sp<VehiclePropertiesHolder> holder = onListProperties();
-            if (holder.get() == NULL) { // given property not found
-                BinderUtil::fillObjectResultReply(reply, false /* isValid */);
-                return NO_ERROR;
-            }
-            std::unique_ptr<VehiclePropConfigs> configs(new VehiclePropConfigs());
-            ASSERT_OR_HANDLE_NO_MEMORY(configs.get(), return NO_MEMORY);
-            VehicleNetworkProtoUtil::toVehiclePropConfigs(holder->getList(), *configs.get());
-            int size = configs->ByteSize();
-            WritableBlobHolder blob(new Parcel::WritableBlob());
-            ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-            BinderUtil::fillObjectResultReply(reply, true);
-            reply->writeInt32(size);
-            reply->writeBlob(size, false, blob.blob);
-            configs->SerializeToArray(blob.blob->data(), size);
-            return NO_ERROR;
-        } break;
-        case ON_PROPERTY_SET: {
-            CHECK_INTERFACE(IVehicleNetworkHalMock, data, reply);
-            if (data.readInt32() == 0) { // java side allows passing null with this.
-                return BAD_VALUE;
-            }
-            ScopedVehiclePropValue value;
-            ReadableBlobHolder blob(new Parcel::ReadableBlob());
-            ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-            int32_t size = data.readInt32();
-            if (size < 0) {
-                ALOGE("setProperty:service, bad blob size %d", size);
-                return BAD_VALUE;
-            }
-            r = data.readBlob(size, blob.blob);
-            if (r != NO_ERROR) {
-                ALOGE("setProperty:service, cannot read blob");
-                return r;
-            }
-            std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-            ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-            if (!v->ParseFromArray(blob.blob->data(), size)) {
-                ALOGE("setProperty:service, cannot parse data");
-                return BAD_VALUE;
-            }
-            r = VehicleNetworkProtoUtil::fromVehiclePropValue(*v.get(), value.value);
-            if (r != NO_ERROR) {
-                ALOGE("setProperty:service, cannot convert data");
-                return BAD_VALUE;
-            }
-            r = onPropertySet(value.value);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case ON_PROPERTY_GET: {
-            CHECK_INTERFACE(IVehicleNetworkHalMock, data, reply);
-            ScopedVehiclePropValue value;
-            r = VehiclePropValueBinderUtil::readFromParcel(data, &value.value,
-                                false /* deleteMembers */, true /*canIgnoreNoData*/);
-            if (r != NO_ERROR) {
-                ALOGE("onPropertyGet cannot read %d", r);
-                return r;
-            }
-            r = onPropertyGet(&(value.value));
-            if (r == NO_ERROR) {
-                BinderUtil::fillObjectResultReply(reply, true);
-                std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-                ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-                VehicleNetworkProtoUtil::toVehiclePropValue(value.value, *v.get());
-                int size = v->ByteSize();
-                WritableBlobHolder blob(new Parcel::WritableBlob());
-                ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-                reply->writeInt32(size);
-                reply->writeBlob(size, false, blob.blob);
-                v->SerializeToArray(blob.blob->data(), size);
-            }
-            return r;
-        } break;
-        case ON_SUBSCRIBE: {
-            CHECK_INTERFACE(IVehicleNetworkHalMock, data, reply);
-            int32_t property = data.readInt32();
-            float sampleRate = data.readFloat();
-            int32_t zones = data.readInt32();
-            r = onPropertySubscribe(property, sampleRate, zones);
-            BinderUtil::fillNoResultReply(reply);
-            return r;
-        } break;
-        case ON_UNSUBSCRIBE: {
-            CHECK_INTERFACE(IVehicleNetworkHalMock, data, reply);
-            int32_t property = data.readInt32();
-            onPropertyUnsubscribe(property);
-            BinderUtil::fillNoResultReply(reply);
-            return NO_ERROR;
-        } break;
-        default:
-            return BBinder::onTransact(code, data, reply, flags);
-    }
-}
-
-}; // namespace android
diff --git a/libvehiclenetwork/native/IVehicleNetworkListener.cpp b/libvehiclenetwork/native/IVehicleNetworkListener.cpp
deleted file mode 100644
index 337b48c..0000000
--- a/libvehiclenetwork/native/IVehicleNetworkListener.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetworkListener"
-
-#include <memory>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-#include <VehicleNetworkProto.pb.h>
-
-#include <IVehicleNetworkListener.h>
-
-#include "VehicleNetworkProtoUtil.h"
-
-namespace android {
-
-enum {
-    ON_EVENTS = IBinder::FIRST_CALL_TRANSACTION,
-    ON_HAL_ERROR,
-    ON_HAL_RESTART,
-    ON_PROPERTY_SET,
-};
-
-class BpVehicleNetworkListener : public BpInterface<IVehicleNetworkListener>
-{
-public:
-    explicit BpVehicleNetworkListener(const sp<IBinder> & impl)
-        : BpInterface<IVehicleNetworkListener>(impl) {
-    }
-
-    virtual void onEvents(sp<VehiclePropValueListHolder>& events) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkListener::getInterfaceDescriptor());
-        std::unique_ptr<VehiclePropValues> values(new VehiclePropValues());
-        ASSERT_OR_HANDLE_NO_MEMORY(values.get(), return NO_MEMORY);
-        status_t r = VehicleNetworkProtoUtil::toVehiclePropValues(events->getList(), *values.get());
-        if (r != NO_ERROR) {
-            ALOGE("onEvents: toVehiclePropValues failed %d", r);
-            return;
-        }
-        data.writeInt32(1); // for java compatibility
-        WritableBlobHolder blob(new Parcel::WritableBlob());
-        int size = values->ByteSize();
-        data.writeInt32(size);
-        data.writeBlob(size, false, blob.blob);
-        values->SerializeToArray(blob.blob->data(), size);
-        remote()->transact(ON_EVENTS, data, &reply);
-    }
-
-    virtual void onHalError(int32_t errorCode, int32_t property, int32_t operation) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkListener::getInterfaceDescriptor());
-        data.writeInt32(errorCode);
-        data.writeInt32(property);
-        data.writeInt32(operation);
-        remote()->transact(ON_HAL_ERROR, data, &reply);
-    }
-
-    virtual void onHalRestart(bool inMocking) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkListener::getInterfaceDescriptor());
-        data.writeInt32(inMocking ? 1 : 0);
-        remote()->transact(ON_HAL_RESTART, data, &reply);
-    }
-
-    virtual void onPropertySet(const vehicle_prop_value_t& value) {
-        Parcel data, reply;
-        data.writeInterfaceToken(IVehicleNetworkListener::getInterfaceDescriptor());
-        status_t r = VehiclePropValueBinderUtil::writeToParcel(data, value);
-        if (r != NO_ERROR) {
-            ALOGE("onPropertySet: failed to write to parcel: %d", r);
-            return;
-        }
-        remote()->transact(ON_PROPERTY_SET, data, &reply);
-    }
-};
-
-IMPLEMENT_META_INTERFACE(VehicleNetworkListener, "com.android.car.vehiclenetwork.IVehicleNetworkListener");
-
-// ----------------------------------------------------------------------
-
-status_t BnVehicleNetworkListener::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
-        uint32_t flags) {
-    status_t r;
-    switch (code) {
-        case ON_EVENTS: {
-            CHECK_INTERFACE(IVehicleNetworkListener, data, reply);
-            if (data.readInt32() == 0) { // java side allows passing null with this.
-                return BAD_VALUE;
-            }
-            List<vehicle_prop_value_t*>* list = new List<vehicle_prop_value_t*>();
-            ASSERT_OR_HANDLE_NO_MEMORY(list, return NO_MEMORY);
-            sp<VehiclePropValueListHolder> holder(new VehiclePropValueListHolder(list));
-            ASSERT_OR_HANDLE_NO_MEMORY(holder.get(), return NO_MEMORY);
-            ReadableBlobHolder blob(new Parcel::ReadableBlob());
-            ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-            int32_t size = data.readInt32();
-            if (size < 0) {
-                ALOGE("onEvents: bad blob size %d", size);
-                return BAD_VALUE;
-            }
-            r = data.readBlob(size, blob.blob);
-            if (r != NO_ERROR) {
-                ALOGE("onEvents: cannot read blob");
-                return r;
-            }
-            std::unique_ptr<VehiclePropValues> v(new VehiclePropValues());
-            ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-            if (!v->ParseFromArray(blob.blob->data(), size)) {
-                ALOGE("onEvents: cannot parse data");
-                return BAD_VALUE;
-            }
-            r = VehicleNetworkProtoUtil::fromVehiclePropValues(*v.get(), *list);
-            if (r != NO_ERROR) {
-                ALOGE("onEvents: cannot convert data");
-                return BAD_VALUE;
-            }
-            onEvents(holder);
-            return NO_ERROR;
-        } break;
-        case ON_HAL_ERROR: {
-            CHECK_INTERFACE(IVehicleNetworkListener, data, reply);
-            int32_t errorCode = data.readInt32();
-            int32_t property = data.readInt32();
-            int32_t operation = data.readInt32();
-            onHalError(errorCode, property, operation);
-            return NO_ERROR;
-        } break;
-        case ON_HAL_RESTART: {
-            CHECK_INTERFACE(IVehicleNetworkListener, data, reply);
-            bool inMocking = (data.readInt32() == 1);
-            onHalRestart(inMocking);
-            return NO_ERROR;
-        } break;
-        case ON_PROPERTY_SET: {
-            CHECK_INTERFACE(IVehicleNetworkListener, data, reply);
-            ScopedVehiclePropValue value;
-            r = VehiclePropValueBinderUtil::readFromParcel(data, &value.value);
-            if (r == NO_ERROR) {
-                onPropertySet(value.value);
-            } else {
-                ALOGE("onPropertySet: failed to read from parcel: %d", r);
-            }
-            return r;
-        } break;
-        default:
-            return BBinder::onTransact(code, data, reply, flags);
-    }
-}
-
-}; // namespace android
diff --git a/libvehiclenetwork/native/VehicleNetwork.cpp b/libvehiclenetwork/native/VehicleNetwork.cpp
deleted file mode 100644
index 2a4c548..0000000
--- a/libvehiclenetwork/native/VehicleNetwork.cpp
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetwork.Lib"
-
-#include <assert.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-
-#include <hardware/vehicle.h>
-
-#include <VehicleNetwork.h>
-
-namespace android {
-
-VehicleNetworkEventMessageHandler::VehicleNetworkEventMessageHandler(const sp<Looper>& looper,
-            sp<VehicleNetworkListener>& listener) :
-            mLooper(looper),
-            mListener(listener) {
-
-}
-
-VehicleNetworkEventMessageHandler::~VehicleNetworkEventMessageHandler() {
-    Mutex::Autolock autoLock(mLock);
-    mEvents.clear();
-    for (VehicleHalError* e : mHalErrors) {
-        delete e;
-    }
-    mHalErrors.clear();
-    mHalRestartEvents.clear();
-    mSetValueEvents.clear();
-}
-
-void VehicleNetworkEventMessageHandler::handleHalEvents(sp<VehiclePropValueListHolder>& events) {
-    Mutex::Autolock autoLock(mLock);
-    mEvents.push_back(events);
-    mLooper->sendMessage(this, Message(EVENT_EVENTS));
-}
-
-void VehicleNetworkEventMessageHandler::handleHalError(int32_t errorCode, int32_t property,
-        int32_t operation) {
-    Mutex::Autolock autoLock(mLock);
-    VehicleHalError* error = new VehicleHalError(errorCode, property, operation);
-    if (error == NULL) {
-        ALOGE("VehicleNetworkEventMessageHandler::handleHalError, new failed");
-        return;
-    }
-    mHalErrors.push_back(error);
-    mLooper->sendMessage(this, Message(EVENT_HAL_ERROR));
-}
-
-void VehicleNetworkEventMessageHandler::handleHalRestart(bool inMocking) {
-    Mutex::Autolock autoLock(mLock);
-    mHalRestartEvents.push_back(inMocking);
-    mLooper->sendMessage(this, Message(EVENT_HAL_RESTART));
-}
-
-void VehicleNetworkEventMessageHandler::handleOnPropertySet(const vehicle_prop_value_t& value) {
-    Mutex::Autolock autoLock(mLock);
-    mSetValueEvents.push_back(VehiclePropValueUtil::allocVehiclePropValue(value));
-    mLooper->sendMessage(this, Message(EVENT_ON_SET));
-}
-
-void VehicleNetworkEventMessageHandler::doHandleHalEvents() {
-    sp<VehiclePropValueListHolder> values;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mEvents.size() > 0) {
-            auto itr = mEvents.begin();
-            values = *itr;
-            mEvents.erase(itr);
-        }
-    } while (false);
-    if (values.get() != NULL) {
-        mListener->onEvents(values);
-    }
-}
-
-void VehicleNetworkEventMessageHandler::doHandleHalError() {
-    VehicleHalError* error = NULL;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mHalErrors.size() > 0) {
-            auto itr = mHalErrors.begin();
-            error = *itr;
-            mHalErrors.erase(itr);
-        }
-    } while (false);
-    if (error != NULL) {
-        mListener->onHalError(error->errorCode, error->property, error->operation);
-        delete error;
-    }
-}
-
-void VehicleNetworkEventMessageHandler::doHandleHalRestart() {
-    bool shouldDispatch = false;
-    bool inMocking = false;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mHalRestartEvents.size() > 0) {
-            auto itr = mHalRestartEvents.begin();
-            inMocking = *itr;
-            mHalRestartEvents.erase(itr);
-            shouldDispatch = true;
-        }
-    } while (false);
-    if (shouldDispatch) {
-        mListener->onHalRestart(inMocking);
-    }
-}
-
-void VehicleNetworkEventMessageHandler::doHandleOnPropertySet() {
-    vehicle_prop_value_t* value = nullptr;
-    {
-        Mutex::Autolock autoLock(mLock);
-        if (!mSetValueEvents.empty()) {
-            auto itr = mSetValueEvents.begin();
-            value = *itr;
-            mSetValueEvents.erase(itr);
-        }
-    }
-    if (value != nullptr) {
-        mListener->onPropertySet(*value);
-        VehiclePropValueUtil::deleteMembers(value);
-        delete value;
-    }
-}
-
-void VehicleNetworkEventMessageHandler::handleMessage(const Message& message) {
-    switch (message.what) {
-        case EVENT_EVENTS:
-            doHandleHalEvents();
-            break;
-        case EVENT_HAL_ERROR:
-            doHandleHalError();
-            break;
-        case EVENT_HAL_RESTART:
-            doHandleHalRestart();
-            break;
-        case EVENT_ON_SET:
-            doHandleOnPropertySet();
-            break;
-    }
-}
-
-// ----------------------------------------------------------------------------
-
-static const int MAX_SERVICE_RETRY = 4;
-
-sp<VehicleNetwork> VehicleNetwork::createVehicleNetwork(sp<VehicleNetworkListener>& listener) {
-    sp<IBinder> binder;
-    int retry = 0;
-    while (true) {
-        binder = defaultServiceManager()->getService(String16(IVehicleNetwork::SERVICE_NAME));
-        if (binder.get() != NULL) {
-            break;
-        }
-        retry++;
-        if (retry > MAX_SERVICE_RETRY) {
-            ALOGE("cannot get VNS, will crash");
-            break;
-        }
-    }
-    ASSERT_ALWAYS_ON_NO_MEMORY(binder.get());
-    sp<IVehicleNetwork> ivn(interface_cast<IVehicleNetwork>(binder));
-    sp<VehicleNetwork> vn;
-    vn = new VehicleNetwork(ivn, listener);
-    ASSERT_ALWAYS_ON_NO_MEMORY(vn.get());
-    // in case thread pool is not started, start it.
-    ProcessState::self()->startThreadPool();
-    return vn;
-}
-
-VehicleNetwork::VehicleNetwork(sp<IVehicleNetwork>& vehicleNetwork,
-        sp<VehicleNetworkListener> &listener) :
-        mService(vehicleNetwork),
-        mClientListener(listener) {
-}
-
-VehicleNetwork::~VehicleNetwork() {
-    sp<IVehicleNetwork> service = getService();
-    IInterface::asBinder(service)->unlinkToDeath(this);
-    service->stopHalRestartMonitoring(this);
-    mHandlerThread->quit();
-}
-
-void VehicleNetwork::onFirstRef() {
-    Mutex::Autolock autoLock(mLock);
-    mHandlerThread = new HandlerThread();
-    status_t r = mHandlerThread->start("VNS.NATIVE_LOOP");
-    if (r != NO_ERROR) {
-        ALOGE("cannot start handler thread, error:%d", r);
-        return;
-    }
-    sp<VehicleNetworkEventMessageHandler> handler(
-            new VehicleNetworkEventMessageHandler(mHandlerThread->getLooper(), mClientListener));
-    ASSERT_ALWAYS_ON_NO_MEMORY(handler.get());
-    mEventHandler = handler;
-    IInterface::asBinder(mService)->linkToDeath(this);
-    mService->startHalRestartMonitoring(this);
-}
-
-status_t VehicleNetwork::setInt32Property(int32_t property, int32_t value) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    v.value_type = VEHICLE_VALUE_TYPE_INT32;
-    v.value.int32_value = value;
-    return setProperty(v);
-}
-
-status_t VehicleNetwork::getInt32Property(int32_t property, int32_t* value, int64_t* timestamp) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    // do not check error as it is always safe to access members for this data type.
-    // saves one if for normal flow.
-    status_t r = getProperty(&v);
-    *value = v.value.int32_value;
-    *timestamp = v.timestamp;
-    return r;
-}
-
-status_t VehicleNetwork::setInt64Property(int32_t property, int64_t value) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    v.value_type = VEHICLE_VALUE_TYPE_INT64;
-    v.value.int64_value = value;
-    return setProperty(v);
-}
-
-status_t VehicleNetwork::getInt64Property(int32_t property, int64_t* value, int64_t* timestamp) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    status_t r = getProperty(&v);
-    *value = v.value.int64_value;
-    *timestamp = v.timestamp;
-    return r;
-}
-
-status_t VehicleNetwork::setFloatProperty(int32_t property, float value) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    v.value_type = VEHICLE_VALUE_TYPE_FLOAT;
-    v.value.float_value = value;
-    return setProperty(v);
-}
-
-status_t VehicleNetwork::getFloatProperty(int32_t property, float* value, int64_t* timestamp) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    status_t r = getProperty(&v);
-    *value = v.value.float_value;
-    *timestamp = v.timestamp;
-    return r;
-}
-
-status_t VehicleNetwork::setStringProperty(int32_t property, const String8& value) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    v.value_type = VEHICLE_VALUE_TYPE_STRING;
-    v.value.str_value.data = (uint8_t*)value.string();
-    v.value.str_value.len = value.length();
-    return setProperty(v);
-}
-
-status_t VehicleNetwork::getStringProperty(int32_t property, String8& value, int64_t* timestamp) {
-    vehicle_prop_value_t v;
-    v.prop = property;
-    v.value.str_value.len = 0;
-    status_t r = getProperty(&v);
-    if (r == NO_ERROR) {
-        value.setTo((char*)v.value.str_value.data, v.value.str_value.len);
-    }
-    *timestamp = v.timestamp;
-    return r;
-}
-
-sp<VehiclePropertiesHolder> VehicleNetwork::listProperties(int32_t property) {
-    return getService()->listProperties(property);
-}
-
-status_t VehicleNetwork::setProperty(const vehicle_prop_value_t& value) {
-    return getService()->setProperty(value);
-}
-
-status_t VehicleNetwork::getProperty(vehicle_prop_value_t* value) {
-    return getService()->getProperty(value);
-}
-
-status_t VehicleNetwork::subscribe(int32_t property, float sampleRate, int32_t zones,
-                                   int32_t flags) {
-    return getService()->subscribe(this, property, sampleRate, zones, flags);
-}
-
-void VehicleNetwork::unsubscribe(int32_t property) {
-    getService()->unsubscribe(this, property);
-}
-
-status_t VehicleNetwork::injectEvent(const vehicle_prop_value_t& value) {
-    return getService()->injectEvent(value);
-}
-
-status_t VehicleNetwork::startMocking(const sp<IVehicleNetworkHalMock>& mock) {
-    return getService()->startMocking(mock);
-}
-
-void VehicleNetwork::stopMocking(const sp<IVehicleNetworkHalMock>& mock) {
-    getService()->stopMocking(mock);
-}
-
-status_t VehicleNetwork::startErrorListening() {
-    return getService()->startErrorListening(this);
-}
-
-void VehicleNetwork::stopErrorListening() {
-    getService()->stopErrorListening(this);
-}
-
-void VehicleNetwork::binderDied(const wp<IBinder>& who) {
-    ALOGE("service died");
-    do {
-        Mutex::Autolock autoLock(mLock);
-        sp<IBinder> ibinder = who.promote();
-        ibinder->unlinkToDeath(this);
-        sp<IBinder> binder = defaultServiceManager()->getService(
-                String16(IVehicleNetwork::SERVICE_NAME));
-        mService = interface_cast<IVehicleNetwork>(binder);
-        IInterface::asBinder(mService)->linkToDeath(this);
-        mService->startHalRestartMonitoring(this);
-    } while (false);
-    onHalRestart(false);
-}
-
-sp<IVehicleNetwork> VehicleNetwork::getService() {
-    Mutex::Autolock autoLock(mLock);
-    return mService;
-}
-
-sp<VehicleNetworkEventMessageHandler> VehicleNetwork::getEventHandler() {
-    Mutex::Autolock autoLock(mLock);
-    return mEventHandler;
-}
-
-void VehicleNetwork::onEvents(sp<VehiclePropValueListHolder>& events) {
-    getEventHandler()->handleHalEvents(events);
-}
-
-void VehicleNetwork::onHalError(int32_t errorCode, int32_t property, int32_t operation) {
-    getEventHandler()->handleHalError(errorCode, property, operation);
-}
-
-void VehicleNetwork::onHalRestart(bool inMocking) {
-    getEventHandler()->handleHalRestart(inMocking);
-}
-
-void VehicleNetwork::onPropertySet(const vehicle_prop_value_t& value) {
-    getEventHandler()->handleOnPropertySet(value);
-}
-}; // namespace android
diff --git a/libvehiclenetwork/native/VehicleNetworkProtoUtil.cpp b/libvehiclenetwork/native/VehicleNetworkProtoUtil.cpp
deleted file mode 100644
index d8d644b..0000000
--- a/libvehiclenetwork/native/VehicleNetworkProtoUtil.cpp
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetwork"
-
-#include <utils/Log.h>
-
-#include <IVehicleNetwork.h>
-#include "VehicleNetworkProtoUtil.h"
-
-#ifdef LOG_MEMORY
-#include <utils/CallStack.h>
-#endif
-
-namespace android {
-
-static status_t copyString(const std::string& in, uint8_t** out, int32_t* len) {
-    *len = in.length();
-    if (*len == 0) {
-        *out = NULL;
-        return NO_ERROR;
-    }
-    *out = new uint8_t[*len];
-    ASSERT_OR_HANDLE_NO_MEMORY(*out, return NO_MEMORY);
-#ifdef LOG_MEMORY
-    ALOGE("allocValueArray %p, l:%d", *out, *len);
-    /* enable to dump stack
-    if (*len > 10000) {
-        CallStack stack;
-        stack.update();
-        stack.log(LOG_TAG, ANDROID_LOG_ERROR);
-    }*/
-#endif
-    memcpy(*out, in.data(), *len);
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::toVehiclePropValue(const vehicle_prop_value_t& in,
-        VehiclePropValue& out, bool /*inPlace*/) {
-    out.set_prop(in.prop);
-    out.set_value_type(in.value_type);
-    out.set_timestamp(in.timestamp);
-    out.set_zone(in.zone);
-    switch (in.value_type) {
-        case VEHICLE_VALUE_TYPE_STRING: {
-            if (in.value.str_value.len > 0) {
-                out.set_string_value((char*)in.value.str_value.data, in.value.str_value.len);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_BYTES: {
-            if (in.value.bytes_value.len > 0) {
-                out.set_bytes_value(in.value.bytes_value.data, in.value.bytes_value.len);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_FLOAT:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC4: {
-            int expectedSize = in.value_type - VEHICLE_VALUE_TYPE_FLOAT + 1;
-            for (int i = 0; i < expectedSize; i++) {
-                out.add_float_values(in.value.float_array[i]);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_INT64: {
-            out.set_int64_value(in.value.int64_value);
-        } break;
-        case VEHICLE_VALUE_TYPE_BOOLEAN:
-        case VEHICLE_VALUE_TYPE_ZONED_BOOLEAN: {
-            out.add_int32_values(in.value.int32_value);
-        } break;
-        case VEHICLE_VALUE_TYPE_INT32:
-        case VEHICLE_VALUE_TYPE_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_INT32_VEC4: {
-            int expectedSize = in.value_type - VEHICLE_VALUE_TYPE_INT32 + 1;
-            for (int i = 0; i < expectedSize; i++) {
-                out.add_int32_values(in.value.int32_array[i]);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_ZONED_INT32:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4: {
-            int expectedSize = in.value_type - VEHICLE_VALUE_TYPE_ZONED_INT32 + 1;
-            for (int i = 0; i < expectedSize; i++) {
-                out.add_int32_values(in.value.int32_array[i]);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4: {
-            int expectedSize = in.value_type - VEHICLE_VALUE_TYPE_ZONED_FLOAT + 1;
-            for (int i = 0; i < expectedSize; i++) {
-                out.add_float_values(in.value.float_array[i]);
-            }
-        } break;
-    }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::fromVehiclePropValue(const VehiclePropValue& in,
-        vehicle_prop_value_t& out, bool /*inPlace*/, bool canIgnoreNoData) {
-    out.prop = in.prop();
-    out.value_type = in.value_type();
-    out.timestamp = in.timestamp();
-    out.zone = in.zone();
-    switch (out.value_type) {
-        case VEHICLE_VALUE_TYPE_STRING: {
-            if (!in.has_string_value()) {
-                // set to NULL so that client can just delete this safely.
-                out.value.str_value.data = NULL;
-                out.value.str_value.len = 0;
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                } else {
-                    ALOGE("fromVehiclePropValue, no string data");
-                    return BAD_VALUE;
-                }
-            }
-            status_t r = copyString(in.string_value(), &(out.value.str_value.data),
-                    &(out.value.str_value.len));
-            if (r != NO_ERROR) {
-                out.value.str_value.data = NULL;
-                out.value.str_value.len = 0;
-                ALOGE("copyString for string failed %d", r);
-                return r;
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_BYTES: {
-            if (!in.has_bytes_value()) {
-                out.value.bytes_value.data = NULL;
-                out.value.bytes_value.len = 0;
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                } else {
-                    ALOGE("fromVehiclePropValue, no byte data");
-                    return BAD_VALUE;
-                }
-            }
-            status_t r = copyString(in.bytes_value(), &(out.value.bytes_value.data),
-                    &(out.value.bytes_value.len));
-            if (r != NO_ERROR) {
-                out.value.bytes_value.data = NULL;
-                out.value.bytes_value.len = 0;
-                ALOGE("copyString for bytes failed %d", r);
-                return r;
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_FLOAT:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC4: {
-            int expectedSize = out.value_type - VEHICLE_VALUE_TYPE_FLOAT + 1;
-            if (in.float_values_size() != expectedSize) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("float value, wrong size %d, expecting %d", in.float_values_size(),
-                        expectedSize);
-                return BAD_VALUE;
-            }
-            for (int i = 0; i < expectedSize; i++) {
-                out.value.float_array[i] = in.float_values(i);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_INT64: {
-            if (!in.has_int64_value()) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("no int64 value");
-                return BAD_VALUE;
-            }
-            out.value.int64_value = in.int64_value();
-        } break;
-        case VEHICLE_VALUE_TYPE_BOOLEAN:
-        case VEHICLE_VALUE_TYPE_ZONED_BOOLEAN: {
-            if (in.int32_values_size() != 1) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("no int32 value");
-                return BAD_VALUE;
-            }
-            out.value.int32_value = in.int32_values(0);
-        } break;
-        case VEHICLE_VALUE_TYPE_INT32:
-        case VEHICLE_VALUE_TYPE_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_INT32_VEC4: {
-            int expectedSize = out.value_type - VEHICLE_VALUE_TYPE_INT32 + 1;
-            if (in.int32_values_size() != expectedSize) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("int32 value, wrong size %d, expecting %d", in.int32_values_size(),
-                        expectedSize);
-                return BAD_VALUE;
-            }
-            for (int i = 0; i < expectedSize; i++) {
-                out.value.int32_array[i] = in.int32_values(i);
-            }
-        } break;
-
-        case VEHICLE_VALUE_TYPE_ZONED_INT32:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4: {
-            int expectedSize = out.value_type - VEHICLE_VALUE_TYPE_ZONED_INT32 + 1;
-            if (in.int32_values_size() != expectedSize) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("int32 value, wrong size %d, expecting %d", in.int32_values_size(),
-                        expectedSize);
-                return BAD_VALUE;
-            }
-            for (int i = 0; i < expectedSize; i++) {
-                out.value.int32_array[i] = in.int32_values(i);
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4:{
-            int expectedSize = out.value_type - VEHICLE_VALUE_TYPE_ZONED_FLOAT + 1;
-            if (in.float_values_size() != expectedSize) {
-                if (canIgnoreNoData) {
-                    return NO_ERROR;
-                }
-                ALOGE("float value, wrong size %d, expecting %d", in.float_values_size(),
-                        expectedSize);
-                return BAD_VALUE;
-            }
-            for (int i = 0; i < expectedSize; i++) {
-                out.value.float_array[i] = in.float_values(i);
-            }
-        } break;
-        default: {
-            if (canIgnoreNoData) {
-                return NO_ERROR;
-            }
-            ALOGE("fromVehiclePropValue unknown type 0x%x", out.value_type);
-            return BAD_VALUE;
-        }
-    }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::toVehiclePropValues(const List<vehicle_prop_value_t*>& in,
-            VehiclePropValues& out) {
-    status_t r;
-    for (auto& v : in) {
-        VehiclePropValue* value = out.add_values();
-        r = toVehiclePropValue(*v, *value);
-        if (r != NO_ERROR) {
-            out.clear_values();
-            return r;
-        }
-    }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::fromVehiclePropValues(const VehiclePropValues& in,
-            List<vehicle_prop_value_t*>& out) {
-    status_t r;
-    for (int i = 0; i < in.values_size(); i++) {
-        vehicle_prop_value_t* v =  new vehicle_prop_value_t();
-        ASSERT_OR_HANDLE_NO_MEMORY(v, r = NO_MEMORY;goto error);
-        memset(v, 0, sizeof(vehicle_prop_value_t));
-        r = fromVehiclePropValue(in.values(i), *v);
-        if (r != NO_ERROR) {
-            delete v;
-            goto error;
-        }
-        out.push_back(v);
-    }
-    return NO_ERROR;
-error:
-    // clean up everything in List
-    for (auto pv : out) {
-        VehiclePropValueUtil::deleteMembers(pv);
-    }
-    return r;
-}
-
-status_t VehicleNetworkProtoUtil::toVehiclePropConfig(const vehicle_prop_config_t& in,
-        VehiclePropConfig& out) {
-    out.set_prop(in.prop);
-    out.set_access(in.access);
-    out.set_change_mode(in.change_mode);
-    out.set_value_type(in.value_type);
-    out.set_permission_model(in.permission_model);
-    out.set_zones(in.vehicle_zone_flags);
-    for (unsigned int i = 0; i < sizeof(in.config_array) / sizeof(int32_t); i++) {
-        out.add_config_array(in.config_array[i]);
-    }
-    if (in.config_string.data != NULL && in.config_string.len != 0) {
-        out.set_config_string((char*)in.config_string.data, in.config_string.len);
-    } else {
-        out.clear_config_string();
-    }
-    int numZones = VehicleNetworkUtil::countNumberOfZones(in.vehicle_zone_flags);
-    if (numZones == 0) {
-        numZones = 1;
-    }
-    switch (in.value_type) {
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4:
-        case VEHICLE_VALUE_TYPE_FLOAT:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC4: {
-            if (in.float_min_values == NULL) {
-                if (in.float_max_values == NULL) {
-                    // all the same min/max
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_float_maxs(in.float_max_value);
-                        out.add_float_mins(in.float_min_value);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, min_values NULL while max_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            } else {
-                if (in.float_max_values != NULL) {
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_float_maxs(in.float_max_values[i]);
-                        out.add_float_mins(in.float_min_values[i]);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, max_values NULL while min_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_INT64: {
-            if (in.int64_min_values == NULL) {
-                if (in.int64_max_values == NULL) {
-                    // all the same min/max
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_int64_maxs(in.int64_max_value);
-                        out.add_int64_mins(in.int64_min_value);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, min_values NULL while max_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            } else {
-                if (in.int64_max_values != NULL) {
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_int64_maxs(in.int64_max_values[i]);
-                        out.add_int64_mins(in.int64_min_values[i]);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, max_values NULL while min_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_ZONED_INT32:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4:
-        case VEHICLE_VALUE_TYPE_INT32:
-        case VEHICLE_VALUE_TYPE_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_INT32_VEC4: {
-            if (in.int32_min_values == NULL) {
-                if (in.int32_max_values == NULL) {
-                    // all the same min/max
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_int32_maxs(in.int32_max_value);
-                        out.add_int32_mins(in.int32_min_value);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, min_values NULL while max_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            } else {
-                if (in.int32_max_values != NULL) {
-                    for (int i = 0; i < numZones; i++) {
-                        out.add_int32_maxs(in.int32_max_values[i]);
-                        out.add_int32_mins(in.int32_min_values[i]);
-                    }
-                } else { // invalid combination
-                    ALOGW("Zoned property 0x%x, max_values NULL while min_values not NULL",
-                            in.prop);
-                    return BAD_VALUE;
-                }
-            }
-        } break;
-    }
-    out.set_sample_rate_max(in.max_sample_rate);
-    out.set_sample_rate_min(in.min_sample_rate);
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::fromVehiclePropConfig(const VehiclePropConfig& in,
-        vehicle_prop_config_t& out) {
-    out.prop = in.prop();
-    out.access = in.access();
-    out.change_mode = in.change_mode();
-    out.value_type = in.value_type();
-    out.permission_model = in.permission_model();
-    out.vehicle_zone_flags = in.zones();
-    int maxConfigSize = sizeof(out.config_array) / sizeof(int32_t);
-    int configSize = in.config_array_size();
-    if (configSize > maxConfigSize) {
-        return BAD_VALUE;
-    }
-    int i = 0;
-    for (; i < configSize; i++) {
-        out.config_array[i] = in.config_array(i);
-    }
-    for (; i < maxConfigSize; i++) {
-        out.config_array[i] = 0;
-    }
-    if (in.has_config_string()) {
-        status_t r = copyString(in.config_string(), &(out.config_string.data),
-                &(out.config_string.len));
-        if (r != NO_ERROR) {
-            return r;
-        }
-    } else {
-        out.config_string.data = NULL;
-        out.config_string.len = 0;
-    }
-    int numZones = VehicleNetworkUtil::countNumberOfZones(out.vehicle_zone_flags);
-    if (numZones == 0) {
-        numZones = 1;
-    }
-    switch (out.value_type) {
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4:
-        case VEHICLE_VALUE_TYPE_FLOAT:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC2:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC3:
-        case VEHICLE_VALUE_TYPE_FLOAT_VEC4: {
-            int maxSize = in.float_maxs_size();
-            int minSize = in.float_mins_size();
-            if (maxSize != minSize) {
-                ALOGW("Zoned property 0x%x, config maxSize %d minSize %d", out.prop, maxSize,
-                        minSize);
-                return BAD_VALUE;
-            }
-            if (maxSize == 0) {
-                out.float_max_value = 0;
-                out.float_min_value = 0;
-                out.float_max_values = NULL;
-                out.float_min_values = NULL;
-            } else if (maxSize == 1) { // one for all
-                out.float_max_value = in.float_maxs(0);
-                out.float_min_value = in.float_mins(0);
-                out.float_max_values = NULL;
-                out.float_min_values = NULL;
-            } else {
-                if ((numZones > 1) && (numZones != maxSize)) {
-                    ALOGW("Zoned property 0x%x, config maxSize %d num Zones %d", out.prop, maxSize,
-                                            numZones);
-                    return BAD_VALUE;
-                }
-                out.float_max_values = new float[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.float_max_values, return NO_MEMORY);
-                out.float_min_values = new float[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.float_min_values, return NO_MEMORY);
-                for (int i = 0; i < maxSize; i++) {
-                    out.float_max_values[i] = in.float_maxs(i);
-                    out.float_min_values[i] = in.float_mins(i);
-                }
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_INT64: {
-            int maxSize = in.int64_maxs_size();
-            int minSize = in.int64_mins_size();
-            if (maxSize != minSize) {
-                ALOGW("Zoned property 0x%x, config maxSize %d minSize %d", out.prop, maxSize,
-                        minSize);
-                return BAD_VALUE;
-            }
-            if (maxSize == 0) {
-                out.int64_max_value = 0;
-                out.int64_min_value = 0;
-                out.int64_max_values = NULL;
-                out.int64_min_values = NULL;
-            } else if (maxSize == 1) { // one for all
-                out.int64_max_value = in.int64_maxs(0);
-                out.int64_min_value = in.int64_mins(0);
-                out.int64_max_values = NULL;
-                out.int64_min_values = NULL;
-            } else {
-                if ((numZones > 1) && (numZones != maxSize)) {
-                    ALOGW("Zoned property 0x%x, config maxSize %d num Zones %d", out.prop, maxSize,
-                            numZones);
-                    return BAD_VALUE;
-                }
-                out.int64_max_values = new int64_t[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.int64_max_values, return NO_MEMORY);
-                out.int64_min_values = new int64_t[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.int64_min_values, return NO_MEMORY);
-                for (int i = 0; i < maxSize; i++) {
-                    out.int64_max_values[i] = in.int64_maxs(i);
-                    out.int64_min_values[i] = in.int64_mins(i);
-                }
-            }
-        } break;
-        case VEHICLE_VALUE_TYPE_ZONED_INT32:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4:
-        case VEHICLE_VALUE_TYPE_INT32:
-        case VEHICLE_VALUE_TYPE_INT32_VEC2:
-        case VEHICLE_VALUE_TYPE_INT32_VEC3:
-        case VEHICLE_VALUE_TYPE_INT32_VEC4: {
-            int maxSize = in.int32_maxs_size();
-            int minSize = in.int32_mins_size();
-            if (maxSize != minSize) {
-                ALOGW("Zoned property 0x%x, config maxSize %d minSize %d", out.prop, maxSize,
-                        minSize);
-                return BAD_VALUE;
-            }
-            if (maxSize == 0) {
-                out.int32_max_value = 0;
-                out.int32_min_value = 0;
-                out.int32_max_values = NULL;
-                out.int32_min_values = NULL;
-            } else if (maxSize == 1) { // one for all
-                out.int32_max_value = in.int32_maxs(0);
-                out.int32_min_value = in.int32_mins(0);
-                out.int32_max_values = NULL;
-                out.int32_min_values = NULL;
-            } else {
-                if ((numZones > 1) && (numZones != maxSize)) {
-                    ALOGW("Zoned property 0x%x, config maxSize %d num Zones %d", out.prop, maxSize,
-                                            numZones);
-                    return BAD_VALUE;
-                }
-                out.int32_max_values = new int32_t[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.int32_max_values, return NO_MEMORY);
-                out.int32_min_values = new int32_t[maxSize];
-                ASSERT_OR_HANDLE_NO_MEMORY(out.int32_min_values, return NO_MEMORY);
-                for (int i = 0; i < maxSize; i++) {
-                    out.int32_max_values[i] = in.int32_maxs(i);
-                    out.int32_min_values[i] = in.int32_mins(i);
-                }
-            }
-        } break;
-    }
-    out.max_sample_rate = in.sample_rate_max();
-    out.min_sample_rate = in.sample_rate_min();
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::toVehiclePropConfigs(List<vehicle_prop_config_t const*> &in,
-        VehiclePropConfigs& out) {
-    status_t r;
-    for (auto& inEntry : in) {
-        VehiclePropConfig* config = out.add_configs();
-        r = toVehiclePropConfig(*inEntry, *config);
-        if (r != NO_ERROR) {
-            out.clear_configs();
-            return r;
-        }
-    }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkProtoUtil::fromVehiclePropConfigs(const VehiclePropConfigs& in,
-        List<vehicle_prop_config_t const*>& out) {
-    int32_t n = in.configs_size();
-    status_t r;
-    for (int32_t i = 0; i < n; i++) {
-        vehicle_prop_config_t* entry = new vehicle_prop_config_t();
-        ASSERT_OR_HANDLE_NO_MEMORY(entry, r = NO_MEMORY; goto error);
-        memset(entry, 0, sizeof(vehicle_prop_config_t));
-        r = fromVehiclePropConfig(in.configs(i), *entry);
-        if (r != NO_ERROR) {
-            goto error;
-        }
-        out.push_back(entry);
-    }
-    return NO_ERROR;
-error:
-    for (auto& e : out) {
-        vehicle_prop_config_t* eDelete = const_cast<vehicle_prop_config_t*>(e);
-        VehiclePropertiesUtil::deleteMembers(eDelete);
-        delete eDelete;
-    }
-    out.clear();
-    return r;
-}
-
-status_t VehiclePropValueBinderUtil::writeToParcel(Parcel& parcel,
-        const vehicle_prop_value_t& value) {
-    parcel.writeInt32(1); // 0 means no value. For compatibility with aidl based code.
-    std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-    ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-    VehicleNetworkProtoUtil::toVehiclePropValue(value, *v.get());
-    int size = v->ByteSize();
-    WritableBlobHolder blob(new Parcel::WritableBlob());
-    ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-    parcel.writeInt32(size);
-    parcel.writeBlob(size, false, blob.blob);
-    v->SerializeToArray(blob.blob->data(), size);
-    return NO_ERROR;
-}
-
-status_t VehiclePropValueBinderUtil::readFromParcel(const Parcel& parcel,
-        vehicle_prop_value_t* value, bool deleteMembers, bool canIgnoreNoData) {
-    if (parcel.readInt32() == 0) { // no result
-        ALOGE("readFromParcel, null data");
-        return BAD_VALUE;
-    }
-    ReadableBlobHolder blob(new Parcel::ReadableBlob());
-    ASSERT_OR_HANDLE_NO_MEMORY(blob.blob, return NO_MEMORY);
-    int32_t size = parcel.readInt32();
-    if (size < 0) {
-        ALOGE("readFromParcel, bad blob size %d", size);
-        return BAD_VALUE;
-    }
-    status_t status = parcel.readBlob(size, blob.blob);
-    if (status != NO_ERROR) {
-        ALOGE("readFromParcel, cannot read blob");
-        return status;
-    }
-    std::unique_ptr<VehiclePropValue> v(new VehiclePropValue());
-    ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-    if (!v->ParseFromArray(blob.blob->data(), size)) {
-        ALOGE("readFromParcel, cannot parse");
-        return BAD_VALUE;
-    }
-    if (deleteMembers) {
-        VehiclePropValueUtil::deleteMembers(value);
-    }
-    return VehicleNetworkProtoUtil::fromVehiclePropValue(*v.get(), *value, false /*inPlace*/,
-            canIgnoreNoData);
-}
-
-}; //namespace android
-
diff --git a/libvehiclenetwork/native/VehicleNetworkProtoUtil.h b/libvehiclenetwork/native/VehicleNetworkProtoUtil.h
deleted file mode 100644
index 2c8c3bb..0000000
--- a/libvehiclenetwork/native/VehicleNetworkProtoUtil.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_NETWORK_PROTO_UTIL_H
-#define ANDROID_VEHICLE_NETWORK_PROTO_UTIL_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <string.h>
-
-#include <memory>
-
-#include <hardware/vehicle.h>
-
-#include <utils/List.h>
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
-#include <binder/IMemory.h>
-#include <binder/Parcel.h>
-
-#include <VehicleNetworkProto.pb.h>
-
-//#define LOG_MEMORY
-
-namespace android {
-
-class VehicleNetworkProtoUtil {
-public:
-    static status_t toVehiclePropValue(const vehicle_prop_value_t& in,
-            VehiclePropValue& out, bool inPlace = false);
-
-    static status_t fromVehiclePropValue(const VehiclePropValue& in, vehicle_prop_value_t& out,
-            bool inPlace = false, bool canIgnoreNoData = false);
-
-    static status_t toVehiclePropValues(const List<vehicle_prop_value_t*>& in,
-            VehiclePropValues& out);
-
-    static status_t fromVehiclePropValues(const VehiclePropValues& in,
-            List<vehicle_prop_value_t*>& out);
-
-    static status_t toVehiclePropConfig(const vehicle_prop_config& in, VehiclePropConfig& out);
-
-    static status_t fromVehiclePropConfig(const VehiclePropConfig& in, vehicle_prop_config& out);
-
-    static status_t toVehiclePropConfigs(List<vehicle_prop_config_t const*> &in,
-            VehiclePropConfigs& out);
-
-    static status_t fromVehiclePropConfigs(const VehiclePropConfigs& in,
-            List<vehicle_prop_config_t const*>& out);
-};
-
-// ----------------------------------------------------------------------------
-
-class WritableBlobHolder {
-public:
-    Parcel::WritableBlob* blob;
-
-    WritableBlobHolder(Parcel::WritableBlob* aBlob)
-        : blob(aBlob) {
-#ifdef LOG_MEMORY
-        ALOGE("WriteBlobHolder, blob %p", aBlob);
-#endif
-    }
-
-    virtual ~WritableBlobHolder() {
-        if (blob != NULL) {
-#ifdef LOG_MEMORY
-            ALOGE("~WriteBlobHolder, blob %p", blob);
-#endif
-            delete blob;
-        }
-    }
-};
-
-// ----------------------------------------------------------------------------
-
-// duplicated here is Blob is not public.
-class ReadableBlobHolder {
-public:
-    Parcel::ReadableBlob* blob;
-
-    ReadableBlobHolder(Parcel::ReadableBlob* aBlob)
-        : blob(aBlob) {
-#ifdef LOG_MEMORY
-        ALOGE("ReadBlobHolder, blob %p", aBlob);
-#endif
-    }
-
-    virtual ~ReadableBlobHolder() {
-        if (blob != NULL) {
-#ifdef LOG_MEMORY
-            ALOGE("~ReadBlobHolder, blob %p", blob);
-#endif
-            delete blob;
-        }
-    }
-};
-
-class VehiclePropValueBinderUtil {
-public:
-    static status_t writeToParcel(Parcel& parcel, const vehicle_prop_value_t& value);
-
-    static status_t readFromParcel(const Parcel& parcel, vehicle_prop_value_t* value,
-            bool deleteMembers = true, bool canIgnoreNoData = false);
-};
-
-}; // namespace android
-
-#endif /* ANDROID_VEHICLE_NETWORK_PROTO_UTIL_H */
diff --git a/libvehiclenetwork/proto/Android.mk b/libvehiclenetwork/proto/Android.mk
deleted file mode 100644
index eb30886..0000000
--- a/libvehiclenetwork/proto/Android.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2015 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_SRC_FILES := $(call all-proto-files-under, .)
-
-LOCAL_SHARED_LIBRARIES := \
-    libprotobuf-cpp-lite
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-
-LOCAL_MODULE := libvehiclenetworkproto-native
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-generated_sources_dir := $(call local-generated-sources-dir)
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
-    $(generated_sources_dir)/proto/packages/services/Car/libvehiclenetwork/proto/
-
-include $(BUILD_STATIC_LIBRARY)
-
-# =======================================================
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-proto-files-under, .)
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-
-LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)
-
-LOCAL_MODULE := libvehiclenetworkproto-java
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/libvehiclenetwork/proto/VehicleNetworkProto.proto b/libvehiclenetwork/proto/VehicleNetworkProto.proto
deleted file mode 100644
index 487ecfd..0000000
--- a/libvehiclenetwork/proto/VehicleNetworkProto.proto
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-syntax = "proto2";
-option java_package = "com.android.car.vehiclenetwork";
-option optimize_for = LITE_RUNTIME;
-
-message VehiclePropConfig {
-    required int32 prop = 1;
-    required int32 access = 2;
-    required int32 change_mode = 3;
-    required int32 value_type = 4;
-    required int32 permission_model = 5;
-    optional int32 zones = 6;
-    repeated int32 config_array = 7;
-    required float sample_rate_max = 8;
-    required float sample_rate_min = 9;
-    optional string config_string = 10;
-    repeated float float_maxs = 11;
-    repeated float float_mins = 12;
-    repeated int32 int32_maxs = 13;
-    repeated int32 int32_mins = 14;
-    repeated int64 int64_maxs = 15;
-    repeated int64 int64_mins = 16;
-};
-
-message VehiclePropConfigs {
-    repeated VehiclePropConfig configs = 1;
-};
-
-message VehiclePropValue {
-    // common data
-    required int32 prop = 1;
-    required int32 value_type = 2;
-    optional int64 timestamp = 3; // required for valid data from HAL, but can be skipped for set.
-    // values
-    optional int32 zone = 4;
-    repeated int32 int32_values= 5; // this also covers boolean value.
-    optional int64 int64_value = 6;
-    repeated float float_values = 7;
-    optional string string_value = 8;
-    optional bytes bytes_value = 9;
-};
-
-message VehiclePropValues {
-    repeated VehiclePropValue values = 1;
-};
diff --git a/libvehiclenetwork/tool/vehiclehal_code_gen.py b/libvehiclenetwork/tool/vehiclehal_code_gen.py
deleted file mode 100755
index e208e8c..0000000
--- a/libvehiclenetwork/tool/vehiclehal_code_gen.py
+++ /dev/null
@@ -1,291 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2015 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.
-#
-"""Generate Java code from vehicle.h"""
-import os
-import re
-import sys
-
-JAVA_HEADER = \
-"""
-/*
- * Copyright (C) 2015 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.
- */
-
-// Autogenerated from vehicle.h using
-// libvehiclenetwork/tool/vehiclehal_code_gen.py.
-// Do not modify manually.
-
-package com.android.car.vehiclenetwork;
-
-public class VehicleNetworkConsts {
-"""
-
-JAVA_TRAIL = \
-"""
-}
-"""
-
-RE_PROPERTY_PATTERN = r'/\*\*((.(?!\/\/===))*?)\*/\n\#define\s+VEHICLE_PROPERTY_(\S+)\s+(\(0x\S+\))'
-RE_ENUM_PATTERN = r'enum\s+(\S+)\s+\{\S*(.*?)\}'
-RE_ENUM_ENTRY_PATTERN = r'(\S+)\s*=\s*(.*?)[,\n]'
-RE_AUDIO_EXT_ROUTING_PATTERN = r'\n\#define\s+VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_(\S+)\s+\"(\S+)\"'
-
-class PropertyInfo(object):
-  def __init__(self, value, name):
-    self.value = value
-    self.name = name
-    self.type = ""
-    self.changeMode = ""
-    self.access = ""
-    self.unit = ""
-    self.startEnd = 0 # _START/END property
-    self.zoneType = ""
-
-  def __str__(self):
-    r = ["value:" + self.value]
-    r.append("name:" + self.name)
-    if self.type != "":
-      r.append("type:" + self.type)
-    if self.changeMode != "":
-      r.append("changeMode:" + self.changeMode)
-    if self.access != "":
-      r.append("access:" + self.access)
-    if self.unit != "":
-      r.append("unit:" + self.unit)
-    return " ".join(r)
-
-class EnumInfo(object):
-  def __init__(self, name):
-    self.name = name
-    self.enums = [] #(name, value) tuple
-  def addEntry(self, name, value):
-    self.enums.append((name, value))
-  def __str__(self):
-    r = [self.name + "\n"]
-    for e in self.enums:
-      r.append("  " + e[0] + ":" + e[1] + "\n")
-    return ''.join(r)
-
-def toJavaStyleName(name):
-  # do not convert if 1st letter is already upper
-  if name[0].isupper():
-    return name
-  words = name.split("_")
-  #print words
-  for i in range(len(words)):
-    w = words[i]
-    w = w[0].upper() + w[1:]
-    words[i] = w
-  return ''.join(words)
-
-JAVA_INT_DEF = "public static final int "
-def printProperties(props):
-  for p in props:
-    print JAVA_INT_DEF + p.name + " = " + p.value + ";"
-
-  #now impement getVehicleValueType
-  print \
-"""public static int getVehicleValueType(int property) {
-switch (property) {"""
-  for p in props:
-    if p.type != "":
-      print "case " + p.name + ": return VehicleValueType." + p.type + ";"
-  print \
-"""default: return VehicleValueType.VEHICLE_VALUE_TYPE_SHOUD_NOT_USE;
-}
-}
-"""
-  #now implement getVehiclePropertyName
-  print \
-"""public static String getVehiclePropertyName(int property) {
-switch (property) {"""
-  for p in props:
-    if (p.startEnd == 0):
-      print "case " + p.name + ': return "' + p.name +     '";'
-  print \
-"""default: return "UNKNOWN_PROPERTY";
-}
-}
-"""
-  #now implement getVehicleChangeMode
-  print \
-"""public static int[] getVehicleChangeMode(int property) {
-switch (property) {"""
-  for p in props:
-    if p.changeMode != "":
-      modes = p.changeMode.split('|')
-      modesString = []
-      for m in modes:
-        modesString.append("VehiclePropChangeMode." + m)
-      print "case " + p.name + ": return new int[] { " + " , ".join(modesString) + " };"
-  print \
-"""default: return null;
-}
-}
-"""
-  #now implement getVehicleAccess
-  print \
-"""public static int[] getVehicleAccess(int property) {
-switch (property) {"""
-  for p in props:
-    if p.access != "":
-      accesses = p.access.split('|')
-      accessesString = []
-      for a in accesses:
-        accessesString.append("VehiclePropAccess." + a)
-      print "case " + p.name + ": return new int[] { " + " , ".join(accessesString) + " };"
-  print \
-"""default: return null;
-}
-}
-"""
-  #now implement getVehicleZoneType
-  print \
-"""public static int getVehicleZoneType(int property) {
-switch (property) {"""
-  for p in props:
-    if p.zoneType != "":
-      print "case " + p.name + ": return VehicleZoneType." + p.zoneType + " ;"
-  print \
-"""default: return VehicleZoneType.VEHICLE_ZONE_TYPE_NONE;
-}
-}
-"""
-
-def printEnum(e):
-  print "public static class " + toJavaStyleName(e.name) + " {"
-  for entry in e.enums:
-    print JAVA_INT_DEF + entry[0] + " = " + entry[1] + ";"
-  #now implement enumToString
-  print \
-"""public static String enumToString(int v) {
-switch(v) {"""
-  valueStore = []
-  for entry in e.enums:
-    # handling enum with the same value. Print only 1st one.
-    if valueStore.count(entry[1]) == 0:
-      valueStore.append(entry[1])
-      print "case " + entry[0] + ': return "' + entry[0] + '";'
-  print \
-"""default: return "UNKNOWN";
-}
-}
-}
-"""
-
-def printEnums(enums):
-  for e in enums:
-    printEnum(e)
-
-def printExtAudioRoutingSources(audio_ext_routing):
-  for r in audio_ext_routing:
-    print "public static final String VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_" + r + ' = "' + r + '";'
-
-def main(argv):
-  vehicle_h_path = os.path.dirname(os.path.abspath(__file__)) + "/../../../../../hardware/libhardware/include/hardware/vehicle.h"
-  #print vehicle_h_path
-  f = open(vehicle_h_path, 'r')
-  text = f.read()
-  f.close()
-  vehicle_internal_h_path = os.path.dirname(os.path.abspath(__file__)) + "/../include/vehicle-internal.h"
-  f = open(vehicle_internal_h_path, 'r')
-  text = text + f.read()
-  f.close()
-
-  props = []
-  property_re = re.compile(RE_PROPERTY_PATTERN, re.MULTILINE | re.DOTALL)
-  for match in property_re.finditer(text):
-    words = match.group(1).split()
-    name = "VEHICLE_PROPERTY_" + match.group(3)
-    value = match.group(4)
-    if (value[0] == "(" and value[-1] == ")"):
-      value = value[1:-1]
-    prop = PropertyInfo(value, name)
-    i = 0
-    while i < len(words):
-      if words[i] == "@value_type":
-        i += 1
-        prop.type = words[i]
-      elif words[i] == "@change_mode":
-        i += 1
-        prop.changeMode = words[i]
-      elif words[i] == "@access":
-        i += 1
-        prop.access = words[i]
-      elif words[i] == "@unit":
-        i += 1
-        prop.unit = words[i]
-      elif words[i] == "@zone_type":
-        i += 1
-        prop.zoneType = words[i]
-      elif words[i] == "@range_start" or words[i] == "@range_end":
-        prop.startEnd = 1
-      i += 1
-    props.append(prop)
-    #for p in props:
-    #  print p
-
-  enums = []
-  enum_re = re.compile(RE_ENUM_PATTERN, re.MULTILINE | re.DOTALL)
-  enum_entry_re = re.compile(RE_ENUM_ENTRY_PATTERN, re.MULTILINE)
-  for match in enum_re.finditer(text):
-    name = match.group(1)
-    info = EnumInfo(name)
-    for match_entry in enum_entry_re.finditer(match.group(2)):
-      valueName = match_entry.group(1)
-      value = match_entry.group(2)
-      #print valueName, value
-      if value[-1] == ',':
-        value = value[:-1]
-      info.addEntry(valueName, value)
-    enums.append(info)
-  #for e in enums:
-  #  print e
-
-  audio_ext_routing = []
-  audio_ext_routing_re = re.compile(RE_AUDIO_EXT_ROUTING_PATTERN, re.MULTILINE | re.DOTALL)
-  for match in audio_ext_routing_re.finditer(text):
-    #print match
-    name = match.group(1)
-    value = match.group(2)
-    if name != value:
-      print "Warning, AUDIO_EXT_ROUTING_SOURCE_" + name + " does not match " + value
-    else:
-      audio_ext_routing.append(name)
-
-  print JAVA_HEADER
-  printProperties(props)
-  print "\n\n"
-  printExtAudioRoutingSources(audio_ext_routing)
-  print "\n\n"
-  printEnums(enums)
-  print JAVA_TRAIL
-
-if __name__ == '__main__':
-  main(sys.argv)
diff --git a/tests/libvehiclenetwork-native-test/Android.mk b/tests/libvehiclenetwork-native-test/Android.mk
deleted file mode 100644
index 034b066..0000000
--- a/tests/libvehiclenetwork-native-test/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-#  Copyright (C) 2015 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_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
-    find . -name "*.cpp" -and -not -name ".*")) \
-    TestPropertyDef.c \
-    AudioPropertyDef.c
-
-LOCAL_C_INCLUDES += \
-    packages/services/Car/libvehiclenetwork/include \
-    packages/services/Car/libvehiclenetwork/libvehiclenetwork-audio-helper/include
-
-LOCAL_SHARED_LIBRARIES := \
-    libbinder \
-    liblog \
-    libutils \
-    libvehiclenetwork-native
-
-LOCAL_STATIC_LIBRARIES := \
-    libvehiclenetwork-audio-helper
-
-LOCAL_CFLAGS += -Wall -Wextra -Werror
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-LOCAL_MODULE:= libvehiclenetwork_native_tests
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_NATIVE_TEST)
diff --git a/tests/libvehiclenetwork-native-test/AudioPropertyDef.c b/tests/libvehiclenetwork-native-test/AudioPropertyDef.c
deleted file mode 100644
index 0e00c7f..0000000
--- a/tests/libvehiclenetwork-native-test/AudioPropertyDef.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2015 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 <stdint.h>
-#include <sys/types.h>
-
-#include <hardware/vehicle.h>
-#include <vehicle-internal.h>
-
-static vehicle_prop_config_t AUDIO_TEST_PROPERTIES[] = {
-    {
-        .prop = VEHICLE_PROPERTY_AUDIO_FOCUS,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC4,
-        .config_flags = 0x0,
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC2,
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-};
-
-vehicle_prop_config_t const * getTestPropertiesForAudio() {
-    return AUDIO_TEST_PROPERTIES;
-}
-
-int getNumTestPropertiesForAudio() {
-    return sizeof(AUDIO_TEST_PROPERTIES) / sizeof(vehicle_prop_config_t);
-}
-
diff --git a/tests/libvehiclenetwork-native-test/IVehicleNetworkMockedTest.cpp b/tests/libvehiclenetwork-native-test/IVehicleNetworkMockedTest.cpp
deleted file mode 100644
index 4bd5449..0000000
--- a/tests/libvehiclenetwork-native-test/IVehicleNetworkMockedTest.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2015 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 <unistd.h>
-
-#include <gtest/gtest.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-#include <IVehicleNetwork.h>
-
-#include "TestProperties.h"
-#include "VehicleHalMock.h"
-#include "IVehicleNetworkTestListener.h"
-
-namespace android {
-
-class IVehicleNetworkMockedTest : public testing::Test {
-public:
-    IVehicleNetworkMockedTest() {}
-
-    ~IVehicleNetworkMockedTest() {}
-
-    sp<IVehicleNetwork> connectToService() {
-        sp<IBinder> binder = defaultServiceManager()->getService(
-                String16(IVehicleNetwork::SERVICE_NAME));
-        if (binder != NULL) {
-            sp<IVehicleNetwork> vn(interface_cast<IVehicleNetwork>(binder));
-            return vn;
-        }
-        sp<IVehicleNetwork> dummy;
-        return dummy;
-    }
-
-protected:
-    virtual void SetUp() {
-        ProcessState::self()->startThreadPool();
-        mVN = connectToService();
-        ASSERT_TRUE(mVN.get() != NULL);
-        mHalMock = new VehicleHalMock();
-    }
-
-    virtual void TearDown() {
-        mVN->stopMocking(mHalMock);
-    }
-protected:
-    sp<VehicleHalMock> mHalMock;
-    sp<IVehicleNetwork> mVN;
-};
-
-const nsecs_t WAIT_TIMEOUT_NS = 1000000000;
-
-TEST_F(IVehicleNetworkMockedTest, connect) {
-    sp<IVehicleNetwork> vn = connectToService();
-    ASSERT_TRUE(vn.get() != NULL);
-}
-
-TEST_F(IVehicleNetworkMockedTest, listProperties) {
-    mVN->startMocking(mHalMock);
-    sp<VehiclePropertiesHolder> properties = mVN->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    ASSERT_TRUE(mHalMock->isTheSameProperties(properties));
-}
-
-TEST_F(IVehicleNetworkMockedTest, halRestart) {
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    int originalCount = listener->getHalRestartCount();
-    ASSERT_EQ(NO_ERROR, mVN->startHalRestartMonitoring(listener));
-    ASSERT_EQ(NO_ERROR, mVN->startMocking(mHalMock));
-    listener->waitForHalRestart(WAIT_TIMEOUT_NS);
-    ASSERT_EQ(originalCount + 1, listener->getHalRestartCount());
-    mVN->stopMocking(mHalMock);
-    listener->waitForHalRestart(WAIT_TIMEOUT_NS);
-    ASSERT_EQ(originalCount + 2, listener->getHalRestartCount());
-}
-
-TEST_F(IVehicleNetworkMockedTest, halGlobalError) {
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    ASSERT_EQ(NO_ERROR, mVN->startErrorListening(listener));
-    ASSERT_EQ(NO_ERROR, mVN->startMocking(mHalMock));
-    const int ERROR_CODE = -123;
-    const int OPERATION_CODE = 4567;
-    ASSERT_EQ(NO_ERROR, mVN->injectHalError(ERROR_CODE, 0, OPERATION_CODE));
-    listener->waitForHalError(WAIT_TIMEOUT_NS);
-    ASSERT_TRUE(listener->isErrorMatching(ERROR_CODE, 0, OPERATION_CODE));
-    mVN->stopErrorListening(listener);
-}
-
-TEST_F(IVehicleNetworkMockedTest, halPropertyError) {
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    ASSERT_EQ(NO_ERROR, mVN->startMocking(mHalMock));
-    ASSERT_EQ(NO_ERROR, mVN->subscribe(listener, TEST_PROPERTY_ZONED_INT32, 0, 0, 0));
-    const int ERROR_CODE = -123;
-    const int OPERATION_CODE = 4567;
-    ASSERT_EQ(NO_ERROR, mVN->injectHalError(
-            ERROR_CODE, TEST_PROPERTY_ZONED_INT32, OPERATION_CODE));
-    listener->waitForHalError(WAIT_TIMEOUT_NS);
-    ASSERT_TRUE(listener->isErrorMatching(
-            ERROR_CODE, TEST_PROPERTY_ZONED_INT32, OPERATION_CODE));
-    mVN->unsubscribe(listener, TEST_PROPERTY_ZONED_INT32);
-}
-
-TEST_F(IVehicleNetworkMockedTest, subscribeToSetProperty) {
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    ASSERT_EQ(NO_ERROR, mVN->startMocking(mHalMock));
-    ASSERT_EQ(NO_ERROR, mVN->subscribe(listener,
-                                       TEST_PROPERTY_BOOLEAN,
-                                       0 /* rate */,
-                                       0 /* zones */,
-                                       SubscribeFlags::SET_CALL));
-    vehicle_prop_value_t v = {
-            .prop = TEST_PROPERTY_BOOLEAN,
-            .value_type = VEHICLE_VALUE_TYPE_BOOLEAN,
-            .timestamp = elapsedRealtimeNano(),
-            .value = {
-                    .boolean_value = VEHICLE_TRUE
-            }
-    };
-
-    mVN->setProperty(v);
-
-    std::unique_ptr<ScopedVehiclePropValue> actualValue(new ScopedVehiclePropValue());
-    ASSERT_EQ(NO_ERROR, listener->waitForOnPropertySet(WAIT_TIMEOUT_NS, &actualValue));
-
-    ASSERT_EQ(v.prop, actualValue->value.prop);
-    ASSERT_EQ(v.value.boolean_value, actualValue->value.value.boolean_value);
-
-    mVN->unsubscribe(listener, TEST_PROPERTY_BOOLEAN);
-}
-
-TEST_F(IVehicleNetworkMockedTest, subscribeToSetPropertyZoned) {
-    const int PROP = TEST_PROPERTY_ZONED_INT32;
-    const int SUBSCRIBED_ZONE = VEHICLE_ZONE_ROW_1_RIGHT;
-    const int NON_SUBSCRIBED_ZONE = VEHICLE_ZONE_ROW_1_LEFT;
-
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    ASSERT_EQ(NO_ERROR, mVN->startMocking(mHalMock));
-    ASSERT_EQ(NO_ERROR, mVN->subscribe(listener,
-                                       PROP,
-                                       0 /* rate */,
-                                       SUBSCRIBED_ZONE,
-                                       SubscribeFlags::SET_CALL));
-    vehicle_prop_value_t v = {
-            .prop = PROP,
-            .value_type = VEHICLE_VALUE_TYPE_ZONED_INT32,
-            .timestamp = elapsedRealtimeNano(),
-            .zone = NON_SUBSCRIBED_ZONE,  // We do not expect notifications for this zone.
-            .value = {
-                    .int32_value = 42
-            }
-    };
-
-    mVN->setProperty(v);
-
-    std::unique_ptr<ScopedVehiclePropValue> actualValue(new ScopedVehiclePropValue());
-
-    ASSERT_EQ(-ETIMEDOUT, listener->waitForOnPropertySet(WAIT_TIMEOUT_NS, &actualValue));
-
-    v.zone = SUBSCRIBED_ZONE;
-    mVN->setProperty(v);
-    ASSERT_EQ(NO_ERROR, listener->waitForOnPropertySet(WAIT_TIMEOUT_NS, &actualValue));
-
-    ASSERT_EQ(v.prop, actualValue->value.prop);
-    ASSERT_EQ(v.value.int32_value, actualValue->value.value.int32_value);
-
-    mVN->unsubscribe(listener, PROP);
-}
-
-}; // namespace android
diff --git a/tests/libvehiclenetwork-native-test/IVehicleNetworkTest.cpp b/tests/libvehiclenetwork-native-test/IVehicleNetworkTest.cpp
deleted file mode 100644
index 2d13e26..0000000
--- a/tests/libvehiclenetwork-native-test/IVehicleNetworkTest.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2015 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 <unistd.h>
-
-#include <gtest/gtest.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-#include <IVehicleNetwork.h>
-
-#include "IVehicleNetworkTestListener.h"
-
-namespace android {
-
-class IVehicleNetworkTest : public testing::Test {
-public:
-    IVehicleNetworkTest() {}
-
-    ~IVehicleNetworkTest() {}
-
-    sp<IVehicleNetwork> connectToService() {
-        sp<IBinder> binder = defaultServiceManager()->getService(
-                String16(IVehicleNetwork::SERVICE_NAME));
-        if (binder != NULL) {
-            sp<IVehicleNetwork> vn(interface_cast<IVehicleNetwork>(binder));
-            return vn;
-        }
-        sp<IVehicleNetwork> dummy;
-        return dummy;
-    }
-
-    sp<IVehicleNetwork> getDefaultVN() {
-        return mDefaultVN;
-    }
-protected:
-    virtual void SetUp() {
-        ProcessState::self()->startThreadPool();
-        mDefaultVN = connectToService();
-        ASSERT_TRUE(mDefaultVN.get() != NULL);
-    }
-private:
-    sp<IVehicleNetwork> mDefaultVN;
-};
-
-TEST_F(IVehicleNetworkTest, connect) {
-    sp<IVehicleNetwork> vn = connectToService();
-    ASSERT_TRUE(vn.get() != NULL);
-}
-
-TEST_F(IVehicleNetworkTest, listProperties) {
-    sp<IVehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-    }
-    sp<VehiclePropertiesHolder> propertiesIvalid  = vn->listProperties(-1); // no such property
-    ASSERT_TRUE(propertiesIvalid.get() == NULL);
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("query single prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        sp<VehiclePropertiesHolder> singleProperty = vn->listProperties(config->prop);
-        ASSERT_EQ((size_t) 1, singleProperty->getList().size());
-        vehicle_prop_config_t const * newConfig = *singleProperty->getList().begin();
-        ASSERT_EQ(config->prop, newConfig->prop);
-        ASSERT_EQ(config->access, newConfig->access);
-        ASSERT_EQ(config->change_mode, newConfig->change_mode);
-        //TODO add more check
-    }
-}
-
-TEST_F(IVehicleNetworkTest, getProperty) {
-    sp<IVehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        if (config->prop == VEHICLE_PROPERTY_RADIO_PRESET) {
-            continue;
-        }
-        String8 msg = String8::format("getting prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        if ((config->prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                (config->prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-            // internal property requires write to get anything.
-            ScopedVehiclePropValue value;
-            value.value.prop = config->prop;
-            value.value.value_type = config->value_type;
-            status_t r = vn->setProperty(value.value);
-            ASSERT_EQ(NO_ERROR, r);
-        }
-        ScopedVehiclePropValue value;
-        value.value.prop = config->prop;
-        value.value.value_type = config->value_type;
-        status_t r = vn->getProperty(&value.value);
-        if ((config->access & VEHICLE_PROP_ACCESS_READ) == 0) { // cannot read
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            ASSERT_EQ(NO_ERROR, r);
-            ASSERT_EQ(config->value_type, value.value.value_type);
-        }
-    }
-}
-
-//TODO change this test to to safe write
-TEST_F(IVehicleNetworkTest, setProperty) {
-    sp<IVehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        if (config->prop == VEHICLE_PROPERTY_RADIO_PRESET) {
-            continue;
-        }
-        String8 msg = String8::format("setting prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        ScopedVehiclePropValue value;
-        value.value.prop = config->prop;
-        value.value.value_type = config->value_type;
-        status_t r = vn->setProperty(value.value);
-        if ((config->access & VEHICLE_PROP_ACCESS_WRITE) == 0) { // cannot write
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            ASSERT_EQ(NO_ERROR, r);
-        }
-    }
-}
-
-TEST_F(IVehicleNetworkTest, setSubscribe) {
-    sp<IVehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    sp<IVehicleNetworkTestListener> listener(new IVehicleNetworkTestListener());
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("subscribing property 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        status_t r = vn->subscribe(listener, config->prop, config->max_sample_rate,
-                                   0,  /* zones */
-                                   SubscribeFlags::HAL_EVENT);
-        if (((config->access & VEHICLE_PROP_ACCESS_READ) == 0) ||
-                (config->change_mode == VEHICLE_PROP_CHANGE_MODE_STATIC)) { // cannot subscribe
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            if ((config->prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                    (config->prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-                // internal property requires write for event notification.
-                ScopedVehiclePropValue value;
-                value.value.prop = config->prop;
-                value.value.value_type = config->value_type;
-                status_t r = vn->setProperty(value.value);
-                ASSERT_EQ(NO_ERROR, r);
-            }
-            ASSERT_EQ(NO_ERROR, r);
-            ASSERT_TRUE(listener->waitForEvent(config->prop, 2000000000));
-        }
-    }
-    for (auto& config : properties->getList()) {
-        vn->unsubscribe(listener, config->prop);
-    }
-    usleep(1000000);
-    //TODO improve this as this will wait for too long
-    for (auto& config : properties->getList()) {
-        ASSERT_TRUE(!listener->waitForEvent(config->prop, 1000000000));
-    }
-}
-
-}; // namespace android
diff --git a/tests/libvehiclenetwork-native-test/IVehicleNetworkTestListener.h b/tests/libvehiclenetwork-native-test/IVehicleNetworkTestListener.h
deleted file mode 100644
index a297096..0000000
--- a/tests/libvehiclenetwork-native-test/IVehicleNetworkTestListener.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2015 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_IVEHICLENETWORK_TEST_LISTER_H
-#define ANDROID_IVEHICLENETWORK_TEST_LISTER_H
-
-#include <queue>
-
-#include <IVehicleNetworkListener.h>
-
-namespace android {
-
-class IVehicleNetworkTestListener : public BnVehicleNetworkListener {
-public:
-    IVehicleNetworkTestListener() :
-        mHalRestartCount(0),
-        mOnPropertySetValues()
-    {};
-
-    virtual void onEvents(sp<VehiclePropValueListHolder>& events) {
-        String8 msg("events ");
-        Mutex::Autolock autolock(mLock);
-        for (auto& e : events->getList()) {
-            ssize_t index = mEventCounts.indexOfKey(e->prop);
-            if (index < 0) {
-                mEventCounts.add(e->prop, 1); // 1st event
-                msg.appendFormat("0x%x:%d ", e->prop, 1);
-            } else {
-                int count = mEventCounts.valueAt(index);
-                count++;
-                mEventCounts.replaceValueAt(index, count);
-                msg.appendFormat("0x%x:%d ", e->prop, count);
-            }
-        }
-        msg.append("\n");
-        std::cout<<msg.string();
-        mCondition.signal();
-    }
-
-    virtual void onHalError(int32_t errorCode, int32_t property, int32_t operation) {
-        Mutex::Autolock autolock(mHalErrorLock);
-        mErrorCode = errorCode;
-        mProperty = property;
-        mOperation = operation;
-        mHalErrorCondition.signal();
-    }
-
-    virtual void onHalRestart(bool /*inMocking*/) {
-        Mutex::Autolock autolock(mHalRestartLock);
-        mHalRestartCount++;
-        mHalRestartCondition.signal();
-    }
-
-    virtual void onPropertySet(const vehicle_prop_value_t& value) {
-        Mutex::Autolock autolock(mOnPropertySetLock);
-
-        std::unique_ptr<ScopedVehiclePropValue> scopedValue(new ScopedVehiclePropValue);
-        VehiclePropValueUtil::copyVehiclePropValue(&scopedValue->value,
-                                              value);
-        mOnPropertySetValues.push(std::move(scopedValue));
-        mOnPropertySetCondition.signal();
-    }
-
-    void waitForEvents(nsecs_t reltime) {
-        Mutex::Autolock autolock(mLock);
-        mCondition.waitRelative(mLock, reltime);
-    }
-
-    bool waitForEvent(int32_t property, nsecs_t reltime) {
-        Mutex::Autolock autolock(mLock);
-        int startCount = getEventCountLocked(property);
-        int currentCount = startCount;
-        int64_t now = android::elapsedRealtimeNano();
-        int64_t endTime = now + reltime;
-        while ((startCount == currentCount) && (now < endTime)) {
-            mCondition.waitRelative(mLock, endTime - now);
-            currentCount = getEventCountLocked(property);
-            now = android::elapsedRealtimeNano();
-        }
-        return (startCount != currentCount);
-    }
-
-    int getEventCount(int32_t property) {
-        Mutex::Autolock autolock(mLock);
-        return getEventCountLocked(property);
-    }
-
-    int getHalRestartCount() {
-        Mutex::Autolock autolock(mHalRestartLock);
-        return mHalRestartCount;
-    }
-
-    void waitForHalRestart(nsecs_t reltime) {
-        Mutex::Autolock autolock(mHalRestartLock);
-        mHalRestartCondition.waitRelative(mHalRestartLock, reltime);
-    }
-
-    void waitForHalError(nsecs_t reltime) {
-        Mutex::Autolock autolock(mHalErrorLock);
-        mHalErrorCondition.waitRelative(mHalErrorLock, reltime);
-    }
-
-    status_t waitForOnPropertySet(nsecs_t reltime, std::unique_ptr<ScopedVehiclePropValue>* out) {
-        Mutex::Autolock autolock(mOnPropertySetLock);
-
-        status_t r = mOnPropertySetValues.empty()
-                     ? mOnPropertySetCondition.waitRelative(mOnPropertySetLock, reltime)
-                     : NO_ERROR;
-
-        if (r == NO_ERROR) {
-            VehiclePropValueUtil::copyVehiclePropValue(&(*out)->value,  /* dest */
-                                                  mOnPropertySetValues.back()->value /* src */);
-            mOnPropertySetValues.pop();
-        }
-        return r;
-    }
-
-    bool isErrorMatching(int32_t errorCode, int32_t property, int32_t operation) {
-        Mutex::Autolock autolock(mHalErrorLock);
-        return mErrorCode == errorCode && mProperty == property && mOperation == operation;
-    }
-
-private:
-    int getEventCountLocked(int32_t property) {
-        ssize_t index = mEventCounts.indexOfKey(property);
-        if (index < 0) {
-            return 0;
-        } else {
-            return mEventCounts.valueAt(index);
-        }
-    }
-
-
-private:
-    Mutex mLock;
-    Condition mCondition;
-    KeyedVector<int32_t, int> mEventCounts;
-
-    Mutex mHalRestartLock;
-    Condition mHalRestartCondition;
-    int mHalRestartCount;
-
-    Mutex mHalErrorLock;
-    Condition mHalErrorCondition;
-    int32_t mErrorCode;
-    int32_t mProperty;
-    int32_t mOperation;
-
-    Mutex mOnPropertySetLock;
-    Condition mOnPropertySetCondition;
-    std::queue<std::unique_ptr<ScopedVehiclePropValue>> mOnPropertySetValues;
-};
-
-}; // namespace android
-#endif // ANDROID_IVEHICLENETWORK_TEST_LISTER_H
diff --git a/tests/libvehiclenetwork-native-test/TestProperties.h b/tests/libvehiclenetwork-native-test/TestProperties.h
deleted file mode 100644
index 05366fc..0000000
--- a/tests/libvehiclenetwork-native-test/TestProperties.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2015 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_VECHILE_TEST_PROPERTIES_H
-#define ANDROID_VECHILE_TEST_PROPERTIES_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <hardware/hardware.h>
-#include <hardware/vehicle.h>
-
-#define TEST_PROPERTY_STRING (VEHICLE_PROPERTY_CUSTOM_START + 1)
-#define TEST_PROPERTY_BYTES (VEHICLE_PROPERTY_CUSTOM_START + 2)
-#define TEST_PROPERTY_BOOLEAN (VEHICLE_PROPERTY_CUSTOM_START + 3)
-#define TEST_PROPERTY_ZONED_INT32 (VEHICLE_PROPERTY_CUSTOM_START + 4)
-#define TEST_PROPERTY_ZONED_FLOAT (VEHICLE_PROPERTY_CUSTOM_START + 5)
-#define TEST_PROPERTY_ZONED_BOOLEAN (VEHICLE_PROPERTY_CUSTOM_START + 6)
-#define TEST_PROPERTY_INT64 (VEHICLE_PROPERTY_CUSTOM_START + 7)
-#define TEST_PROPERTY_FLOAT (VEHICLE_PROPERTY_CUSTOM_START + 8)
-#define TEST_PROPERTY_FLOAT_VEC2 (VEHICLE_PROPERTY_CUSTOM_START + 9)
-#define TEST_PROPERTY_FLOAT_VEC3 (VEHICLE_PROPERTY_CUSTOM_START + 10)
-#define TEST_PROPERTY_FLOAT_VEC4 (VEHICLE_PROPERTY_CUSTOM_START + 11)
-#define TEST_PROPERTY_INT32 (VEHICLE_PROPERTY_CUSTOM_START + 12)
-#define TEST_PROPERTY_INT32_VEC2 (VEHICLE_PROPERTY_CUSTOM_START + 13)
-#define TEST_PROPERTY_INT32_VEC3 (VEHICLE_PROPERTY_CUSTOM_START + 14)
-#define TEST_PROPERTY_INT32_VEC4 (VEHICLE_PROPERTY_CUSTOM_START + 15)
-
-#endif /* ANDROID_VECHILE_TEST_PROPERTIES_H */
diff --git a/tests/libvehiclenetwork-native-test/TestPropertyDef.c b/tests/libvehiclenetwork-native-test/TestPropertyDef.c
deleted file mode 100644
index 6fa3e9c..0000000
--- a/tests/libvehiclenetwork-native-test/TestPropertyDef.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2015 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 <stdint.h>
-#include <sys/types.h>
-
-#include "TestProperties.h"
-
-static vehicle_prop_config_t TEST_PROPERTIES[] = {
-    {
-        .prop = TEST_PROPERTY_STRING,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_STRING,
-        .config_flags = 0x1234, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_BYTES,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_BYTES,
-        .config_flags = 0x12345, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_BOOLEAN,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_BOOLEAN,
-        .config_flags = 0x123456, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_ZONED_INT32,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_ZONED_INT32,
-        .config_flags = 0x1234567, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .vehicle_zone_flags = VEHICLE_ZONE_ROW_1_LEFT | VEHICLE_ZONE_ROW_1_RIGHT,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_ZONED_FLOAT,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_ZONED_FLOAT,
-        .config_flags = 0x12345678, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_ZONED_BOOLEAN,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_ZONED_BOOLEAN,
-        .config_flags = 0x10, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_INT64,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT64,
-        .config_flags = 0x11, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_FLOAT,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_FLOAT,
-        .config_flags = 0x12, // just random
-        .float_min_value = 0.1f,
-        .float_max_value = 10.0f,
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_FLOAT_VEC2,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_FLOAT_VEC2,
-        .config_flags = 0x13, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_FLOAT_VEC3,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_FLOAT_VEC3,
-        .config_flags = 0x14, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_FLOAT_VEC4,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_FLOAT_VEC4,
-        .config_flags = 0x15, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_INT32,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32,
-        .config_flags = 0x16, // just random
-        .int32_min_value = 10,
-        .int32_max_value = 100,
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_INT32_VEC2,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC2,
-        .config_flags = 0x17, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_INT32_VEC3,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC3,
-        .config_flags = 0x18, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-    {
-        .prop = TEST_PROPERTY_INT32_VEC4,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC4,
-        .config_flags = 0x0, // just random
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-};
-
-vehicle_prop_config_t const * getTestProperties() {
-    return TEST_PROPERTIES;
-}
-
-int getNumTestProperties() {
-    return sizeof(TEST_PROPERTIES) / sizeof(vehicle_prop_config_t);
-}
-
diff --git a/tests/libvehiclenetwork-native-test/VehicleHalMock.h b/tests/libvehiclenetwork-native-test/VehicleHalMock.h
deleted file mode 100644
index 1d43a6d..0000000
--- a/tests/libvehiclenetwork-native-test/VehicleHalMock.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLE_HAL_MOCK_H
-#define ANDROID_VEHICLE_HAL_MOCK_H
-
-#include <IVehicleNetworkHalMock.h>
-
-extern "C" {
-vehicle_prop_config_t const * getTestProperties();
-int getNumTestProperties();
-};
-
-namespace android {
-
-class VehicleHalMock : public BnVehicleNetworkHalMock {
-public:
-    VehicleHalMock() {
-        mProperties = new VehiclePropertiesHolder(false /* deleteConfigsInDestructor */);
-        vehicle_prop_config_t const * properties = getTestProperties();
-        for (int i = 0; i < getNumTestProperties(); i++) {
-            mProperties->getList().push_back(properties + i);
-        }
-    };
-
-    virtual ~VehicleHalMock() {};
-
-    virtual sp<VehiclePropertiesHolder> onListProperties() {
-        return mProperties;
-    };
-
-    virtual status_t onPropertySet(const vehicle_prop_value_t& /*value*/) {
-        return NO_ERROR;
-    };
-
-    virtual status_t onPropertyGet(vehicle_prop_value_t* /*value*/) {
-        return NO_ERROR;
-    };
-
-    virtual status_t onPropertySubscribe(int32_t /*property*/, float /*sampleRate*/,
-            int32_t /*zones*/) {
-        return NO_ERROR;
-    };
-
-    virtual void onPropertyUnsubscribe(int32_t /*property*/) {
-    };
-
-    bool isTheSameProperties(sp<VehiclePropertiesHolder>& list) {
-        if (mProperties->getList().size() != list->getList().size()) {
-            return false;
-        }
-        auto l = mProperties->getList().begin();
-        auto r = list->getList().begin();
-        while (l != mProperties->getList().end() && r != list->getList().end()) {
-            if (!VehiclePropertiesUtil::isTheSame(**l, **r)) {
-                return false;
-            }
-            l++;
-            r++;
-        }
-        return true;
-    }
-
-private:
-    sp<VehiclePropertiesHolder> mProperties;
-
-};
-
-}; // namespace android
-#endif /* ANDROID_VEHICLE_HAL_MOCK_H */
diff --git a/tests/libvehiclenetwork-native-test/VehicleNetworkAudioHelperTest.cpp b/tests/libvehiclenetwork-native-test/VehicleNetworkAudioHelperTest.cpp
deleted file mode 100644
index c75a587..0000000
--- a/tests/libvehiclenetwork-native-test/VehicleNetworkAudioHelperTest.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VehicleNetworkAudioHelperTest"
-
-#include <unistd.h>
-
-#include <gtest/gtest.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-#include <vehicle-internal.h>
-#include <VehicleNetwork.h>
-#include <VehicleNetworkAudioHelper.h>
-
-#include "TestProperties.h"
-#include "VehicleHalMock.h"
-#include "VehicleNetworkTestListener.h"
-
-namespace android {
-
-extern "C" {
-vehicle_prop_config_t const * getTestPropertiesForAudio();
-int getNumTestPropertiesForAudio();
-};
-
-class VehicleHalMockForAudioFocus : public VehicleHalMock {
-public:
-    explicit VehicleHalMockForAudioFocus(sp<VehicleNetwork>& vn)
-        : mVN(vn) {
-        mAudioProperties = new VehiclePropertiesHolder(false /* deleteConfigsInDestructor */);
-        vehicle_prop_config_t const * properties = getTestPropertiesForAudio();
-        for (int i = 0; i < getNumTestPropertiesForAudio(); i++) {
-            mAudioProperties->getList().push_back(properties + i);
-        }
-        mValueToGet.prop = VEHICLE_PROPERTY_AUDIO_FOCUS;
-        mValueToGet.value_type = VEHICLE_VALUE_TYPE_INT32_VEC4;
-        mValueToGet.value.int32_array[0] = 0;
-        mValueToGet.value.int32_array[1] = 0;
-        mValueToGet.value.int32_array[2] = 0;
-        mValueToGet.value.int32_array[3] = 0;
-    }
-    virtual ~VehicleHalMockForAudioFocus() {};
-
-    virtual sp<VehiclePropertiesHolder> onListProperties() {
-        ALOGI("onListProperties");
-        Mutex::Autolock autoLock(mLock);
-        return mAudioProperties;
-    };
-
-    virtual status_t onPropertySet(const vehicle_prop_value_t& value) {
-        ALOGI("onPropertySet 0x%x", value.prop);
-        return NO_ERROR;
-    };
-
-    virtual status_t onPropertyGet(vehicle_prop_value_t* value) {
-        ALOGI("onPropertyGet 0x%x", value->prop);
-        Mutex::Autolock autoLock(mLock);
-        if (value->prop == VEHICLE_PROPERTY_AUDIO_FOCUS) {
-            memcpy(value, &mValueToGet, sizeof(vehicle_prop_value_t));
-        }
-        return NO_ERROR;
-    };
-
-    virtual status_t onPropertySubscribe(int32_t property, float /*sampleRate*/,
-            int32_t /*zones*/) {
-        ALOGI("onPropertySubscribe 0x%x", property);
-        return NO_ERROR;
-    };
-
-    virtual void onPropertyUnsubscribe(int32_t property) {
-        ALOGI("onPropertySubscribe 0x%x", property);
-    };
-
-    void setFocusState(int32_t state, int32_t streams, int32_t extState) {
-        Mutex::Autolock autoLock(mLock);
-        mValueToGet.value.int32_array[VEHICLE_AUDIO_FOCUS_INDEX_FOCUS] = state;
-        mValueToGet.value.int32_array[VEHICLE_AUDIO_FOCUS_INDEX_STREAMS] = streams;
-        mValueToGet.value.int32_array[VEHICLE_AUDIO_FOCUS_INDEX_EXTERNAL_FOCUS_STATE] = extState;
-        mValueToGet.value.int32_array[VEHICLE_AUDIO_FOCUS_INDEX_AUDIO_CONTEXTS] = 0;
-        mValueToGet.timestamp = elapsedRealtimeNano();
-        mVN->injectEvent(mValueToGet);
-    }
-
-    const vehicle_prop_value_t& getCurrentFocus() {
-        Mutex::Autolock autoLock(mLock);
-        return mValueToGet;
-    }
-
-private:
-    sp<VehicleNetwork> mVN;
-    mutable Mutex mLock;
-    sp<VehiclePropertiesHolder> mAudioProperties;
-    vehicle_prop_value_t mValueToGet;
-};
-
-class VehicleNetworkAudioHelperTest : public testing::Test {
-public:
-    VehicleNetworkAudioHelperTest() :
-        mHalMock(NULL),
-        mVN(NULL),
-        mListener(new VehicleNetworkTestListener()) { }
-
-    ~VehicleNetworkAudioHelperTest() {}
-
-    const nsecs_t WAIT_NS = 100000000;
-
-protected:
-    virtual void SetUp() {
-        ASSERT_TRUE(mListener.get() != NULL);
-        sp<VehicleNetworkListener> listener(mListener.get());
-        mVN = VehicleNetwork::createVehicleNetwork(listener);
-        ASSERT_TRUE(mVN.get() != NULL);
-        mHalMock = new VehicleHalMockForAudioFocus(mVN);
-        sp<VehicleHalMock> halMock = mHalMock;
-        mVN->startMocking(halMock);
-        mAudioHelper = new VehicleNetworkAudioHelper();
-        ASSERT_EQ(NO_ERROR, mAudioHelper->init());
-    }
-
-    virtual void TearDown() {
-        mAudioHelper->release();
-        sp<VehicleHalMock> halMock = mHalMock;
-        mVN->stopMocking(halMock);
-    }
-
-    void changeFocusState(int32_t state, int32_t streams, int32_t extState) {
-        mHalMock->setFocusState(state, streams, extState);
-        mVN->injectEvent(mHalMock->getCurrentFocus());
-    }
-
-protected:
-    sp<VehicleHalMockForAudioFocus> mHalMock;
-    sp<VehicleNetwork> mVN;
-    sp<VehicleNetworkTestListener> mListener;
-    sp<VehicleNetworkAudioHelper> mAudioHelper;
-};
-
-TEST_F(VehicleNetworkAudioHelperTest, streamStartStop) {
-    ASSERT_EQ(NO_ERROR, mVN->subscribe(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE, 0));
-    int initialCount = mListener->getEventCount(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE);
-    mAudioHelper->notifyStreamStarted(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0);
-    ASSERT_TRUE(mListener->waitForEvent(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE, initialCount,
-            WAIT_NS));
-    const vehicle_prop_value& lastValue = mListener->getLastValue();
-    ASSERT_EQ(VEHICLE_AUDIO_STREAM_STATE_STARTED,
-            lastValue.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STATE]);
-    ASSERT_EQ(0, lastValue.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STREAM]);
-
-    initialCount = mListener->getEventCount(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE);
-    mAudioHelper->notifyStreamStarted(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1);
-    ASSERT_TRUE(mListener->waitForEvent(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE, initialCount,
-            WAIT_NS));
-    const vehicle_prop_value& lastValue1 = mListener->getLastValue();
-    ASSERT_EQ(VEHICLE_AUDIO_STREAM_STATE_STARTED,
-            lastValue1.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STATE]);
-    ASSERT_EQ(1, lastValue1.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STREAM]);
-
-    initialCount = mListener->getEventCount(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE);
-    mAudioHelper->notifyStreamStopped(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0);
-    ASSERT_TRUE(mListener->waitForEvent(VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE, initialCount,
-            WAIT_NS));
-    const vehicle_prop_value& lastValue2 = mListener->getLastValue();
-    ASSERT_EQ(VEHICLE_AUDIO_STREAM_STATE_STOPPED,
-            lastValue2.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STATE]);
-    ASSERT_EQ(0, lastValue2.value.int32_array[VEHICLE_AUDIO_STREAM_STATE_INDEX_STREAM]);
-}
-
-TEST_F(VehicleNetworkAudioHelperTest, testFocus) {
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_NO_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0));
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_NO_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1));
-    mHalMock->setFocusState(VEHICLE_AUDIO_FOCUS_REQUEST_GAIN, 0x1, 0);
-    // should wait for event first. Otherwise polling will fail as change is not delivered yet.
-    ASSERT_TRUE(mAudioHelper->waitForStreamFocus(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0,
-            WAIT_NS));
-    ASSERT_FALSE(mAudioHelper->waitForStreamFocus(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1,
-            WAIT_NS));
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0));
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_NO_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1));
-    mHalMock->setFocusState(VEHICLE_AUDIO_FOCUS_REQUEST_GAIN, 0x3, 0);
-    ASSERT_TRUE(mAudioHelper->waitForStreamFocus(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0,
-            WAIT_NS));
-    ASSERT_TRUE(mAudioHelper->waitForStreamFocus(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1,
-            WAIT_NS));
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_0));
-    ASSERT_EQ(VEHICLE_NETWORK_AUDIO_HELPER_FOCUS_STATE_FOCUS,
-            mAudioHelper->getStreamFocusState(VEHICLE_NETWORK_AUDIO_HELPER_STREAM_1));
-}
-
-}; // namespace android
diff --git a/tests/libvehiclenetwork-native-test/VehicleNetworkTest.cpp b/tests/libvehiclenetwork-native-test/VehicleNetworkTest.cpp
deleted file mode 100644
index 6df76e3..0000000
--- a/tests/libvehiclenetwork-native-test/VehicleNetworkTest.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2015 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 <unistd.h>
-
-#include <gtest/gtest.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-#include <VehicleNetwork.h>
-
-#include "VehicleNetworkTestListener.h"
-
-namespace android {
-
-// Be careful with name conflict with other tests!. It can lead into wrong virtual function table
-// , leading into mysterious crash. Always add test name in front for any class name.
-class VehicleNetworkTest : public testing::Test {
-public:
-    VehicleNetworkTest() :
-        mVN(NULL),
-        mListener(new VehicleNetworkTestListener()) {
-        String8 msg;
-        msg.appendFormat("Creating VehicleNetworkTest 0x%p %p %p\n", this, mVN.get(),
-                mListener.get());
-        std::cout<<msg.string();
-    }
-
-    virtual ~VehicleNetworkTest() { }
-
-    sp<VehicleNetwork> getDefaultVN() {
-        return mVN;
-    }
-
-    VehicleNetworkTestListener& getTestListener() {
-        return *mListener.get();
-    }
-
-protected:
-    void SetUp() {
-        String8 msg;
-        msg.appendFormat("setUp starts %p %p %p\n", this, mVN.get(),
-                mListener.get());
-        std::cout<<msg.string();
-        ASSERT_TRUE(mListener.get() != NULL);
-        sp<VehicleNetworkListener> listener(mListener.get());
-        mVN = VehicleNetwork::createVehicleNetwork(listener);
-        ASSERT_TRUE(mVN.get() != NULL);
-        std::cout<<"setUp ends\n";
-    }
-
-protected:
-    sp<VehicleNetwork> mVN;
-    sp<VehicleNetworkTestListener> mListener;
-};
-
-
-TEST_F(VehicleNetworkTest, listProperties) {
-    sp<VehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-    }
-    sp<VehiclePropertiesHolder> propertiesIvalid  = vn->listProperties(-1); // no such property
-    ASSERT_TRUE(propertiesIvalid.get() == NULL);
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("query single prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        sp<VehiclePropertiesHolder> singleProperty = vn->listProperties(config->prop);
-        ASSERT_EQ((size_t) 1, singleProperty->getList().size());
-        vehicle_prop_config_t const * newConfig = *singleProperty->getList().begin();
-        ASSERT_EQ(config->prop, newConfig->prop);
-        ASSERT_EQ(config->access, newConfig->access);
-        ASSERT_EQ(config->change_mode, newConfig->change_mode);
-        //TODO add more check
-    }
-}
-
-TEST_F(VehicleNetworkTest, getProperty) {
-    sp<VehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        if (config->prop == VEHICLE_PROPERTY_RADIO_PRESET) {
-            continue;
-        }
-        String8 msg = String8::format("getting prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        ScopedVehiclePropValue value;
-        value.value.prop = config->prop;
-        value.value.value_type = config->value_type;
-        status_t r = vn->getProperty(&value.value);
-        if ((config->access & VEHICLE_PROP_ACCESS_READ) == 0) { // cannot read
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            ASSERT_EQ(NO_ERROR, r);
-            ASSERT_EQ(config->value_type, value.value.value_type);
-        }
-    }
-}
-
-//TODO change this test to to safe write
-TEST_F(VehicleNetworkTest, setProperty) {
-    sp<VehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        if (config->prop == VEHICLE_PROPERTY_RADIO_PRESET) {
-            continue;
-        }
-        String8 msg = String8::format("setting prop 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        ScopedVehiclePropValue value;
-        value.value.prop = config->prop;
-        value.value.value_type = config->value_type;
-        status_t r = vn->setProperty(value.value);
-        if ((config->access & VEHICLE_PROP_ACCESS_WRITE) == 0) { // cannot write
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            ASSERT_EQ(NO_ERROR, r);
-        }
-    }
-}
-
-TEST_F(VehicleNetworkTest, setSubscribe) {
-    sp<VehicleNetwork> vn = getDefaultVN();
-    sp<VehiclePropertiesHolder> properties = vn->listProperties();
-    ASSERT_TRUE(properties.get() != NULL);
-    int32_t numConfigs = properties->getList().size();
-    ASSERT_TRUE(numConfigs > 0);
-    for (auto& config : properties->getList()) {
-        String8 msg = String8::format("subscribing property 0x%x\n", config->prop);
-        std::cout<<msg.string();
-        status_t r = vn->subscribe(config->prop, config->max_sample_rate);
-        if (((config->access & VEHICLE_PROP_ACCESS_READ) == 0) ||
-                (config->change_mode == VEHICLE_PROP_CHANGE_MODE_STATIC)) { // cannot subsctibe
-            ASSERT_TRUE(r != NO_ERROR);
-        } else {
-            if ((config->prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                    (config->prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-                // internal property requires write for event notification.
-                ScopedVehiclePropValue value;
-                value.value.prop = config->prop;
-                value.value.value_type = config->value_type;
-                status_t r = vn->setProperty(value.value);
-                ASSERT_EQ(NO_ERROR, r);
-            }
-            ASSERT_EQ(NO_ERROR, r);
-            ASSERT_TRUE(getTestListener().waitForEvent(config->prop, 0, 2000000000));
-        }
-    }
-    for (auto& config : properties->getList()) {
-        vn->unsubscribe(config->prop);
-    }
-    usleep(1000000);
-    //TODO improve this as this will wait for too long
-    for (auto& config : properties->getList()) {
-        int initialCount = getTestListener().getEventCount(config->prop);
-        ASSERT_TRUE(!getTestListener().waitForEvent(config->prop, initialCount, 1000000000));
-    }
-}
-
-}; // namespace android
diff --git a/tests/libvehiclenetwork-native-test/VehicleNetworkTestListener.h b/tests/libvehiclenetwork-native-test/VehicleNetworkTestListener.h
deleted file mode 100644
index 8c1255b..0000000
--- a/tests/libvehiclenetwork-native-test/VehicleNetworkTestListener.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2015 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_VEHICLENETWORK_TEST_LISTER_H
-#define ANDROID_VEHICLENETWORK_TEST_LISTER_H
-
-#include <IVehicleNetworkListener.h>
-#include <VehicleNetworkDataTypes.h>
-
-namespace android {
-
-class VehicleNetworkTestListener : public VehicleNetworkListener {
-public:
-    VehicleNetworkTestListener()
-    : mEvents(new VehiclePropValueListHolder(new List<vehicle_prop_value_t* >())) {
-        String8 msg;
-        msg.appendFormat("Creating VehicleNetworkTestListener 0x%p\n", this);
-        std::cout<<msg.string();
-    }
-
-    virtual ~VehicleNetworkTestListener() {
-        std::cout<<"destroying VehicleNetworkTestListener\n";
-        for (auto& e : mEvents->getList()) {
-            VehiclePropValueUtil::deleteMembers(e);
-            delete e;
-        }
-    }
-
-    virtual void onEvents(sp<VehiclePropValueListHolder>& events) {
-        String8 msg("events ");
-        Mutex::Autolock autolock(mLock);
-        for (auto& e : events->getList()) {
-            ssize_t index = mEventCounts.indexOfKey(e->prop);
-            if (index < 0) {
-                mEventCounts.add(e->prop, 1); // 1st event
-                msg.appendFormat("0x%x:%d ", e->prop, 1);
-            } else {
-                int count = mEventCounts.valueAt(index);
-                count++;
-                mEventCounts.replaceValueAt(index, count);
-                msg.appendFormat("0x%x:%d ", e->prop, count);
-            }
-            vehicle_prop_value_t* copy = VehiclePropValueUtil::allocVehiclePropValue(*e);
-            mEvents->getList().push_back(copy);
-        }
-        msg.append("\n");
-        std::cout<<msg.string();
-        mCondition.signal();
-    }
-
-    virtual void onHalError(int32_t /*errorCode*/, int32_t /*property*/, int32_t /*operation*/) {
-        //TODO
-    }
-
-    virtual void onHalRestart(bool /*inMocking*/) {
-        //TODO cannot test this in native world without plumbing mocking
-    }
-
-    virtual void onPropertySet(const vehicle_prop_value_t& /* value */) {
-        // TODO
-    }
-
-    void waitForEvents(nsecs_t reltime) {
-        Mutex::Autolock autolock(mLock);
-        mCondition.waitRelative(mLock, reltime);
-    }
-
-    bool waitForEvent(int32_t property, int initialEventCount, nsecs_t reltime) {
-        Mutex::Autolock autolock(mLock);
-        int currentCount = initialEventCount;
-        int64_t now = android::elapsedRealtimeNano();
-        int64_t endTime = now + reltime;
-        while ((initialEventCount == currentCount) && (now < endTime)) {
-            mCondition.waitRelative(mLock, endTime - now);
-            currentCount = getEventCountLocked(property);
-            now = android::elapsedRealtimeNano();
-        }
-        return (initialEventCount != currentCount);
-    }
-
-    int getEventCount(int32_t property) {
-        Mutex::Autolock autolock(mLock);
-        return getEventCountLocked(property);
-    }
-
-    sp<VehiclePropValueListHolder>& getEvents() {
-        // this is nothing more than memory barrier. Just for testing.
-        Mutex::Autolock autolock(mLock);
-        return mEvents;
-    }
-
-    const vehicle_prop_value& getLastValue() {
-        auto itr = getEvents()->getList().end();
-        itr--;
-        return **itr;
-    }
-
-private:
-    int getEventCountLocked(int32_t property) {
-        ssize_t index = mEventCounts.indexOfKey(property);
-        if (index < 0) {
-            return 0;
-        } else {
-            return mEventCounts.valueAt(index);
-        }
-    }
-private:
-    Mutex mLock;
-    Condition mCondition;
-    KeyedVector<int32_t, int> mEventCounts;
-    sp<VehiclePropValueListHolder> mEvents;
-};
-
-}; // namespace android
-#endif // ANDROID_VEHICLENETWORK_TEST_LISTER_H
diff --git a/tests/vehiclenetworkservice_unit_tests/Android.mk b/tests/vehiclenetworkservice_unit_tests/Android.mk
deleted file mode 100644
index 1a353b8..0000000
--- a/tests/vehiclenetworkservice_unit_tests/Android.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-#  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_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
-    find . -name "*.cpp" -and -not -name ".*")) \
-
-LOCAL_C_INCLUDES += \
-    packages/services/Car/libvehiclenetwork/include \
-    packages/services/Car/libvehiclenetwork/libvehiclenetwork-audio-helper/include\
-    packages/services/Car/vehicle_network_service \
-    external/libxml2/include \
-    external/icu/icu4c/source/common
-
-LOCAL_SHARED_LIBRARIES := \
-    libbinder \
-    liblog \
-    libutils \
-    libvehiclenetwork-native \
-    libcutils \
-    libxml2
-
-LOCAL_STATIC_LIBRARIES := \
-    libvehiclenetwork-audio-helper \
-    libvehiclenetworkservice
-
-LOCAL_CFLAGS += -Wall -Wextra -Werror
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-LOCAL_MODULE:= vehiclenetworkservice_unit_tests
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_NATIVE_TEST)
diff --git a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.cpp b/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.cpp
deleted file mode 100644
index 0ecf828..0000000
--- a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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 <VehiclePropertyAccessControlForTesting.h>
-
-namespace android {
-bool VehiclePropertyAccessControlForTesting::isHexNotation(std::string const& s) {
-      return VehiclePropertyAccessControl::isHexNotation(s);
-}
-
-bool VehiclePropertyAccessControlForTesting::accessToInt(int32_t* const value,const xmlChar* property,
-                   const xmlChar* uid, const xmlChar* access) {
-      return VehiclePropertyAccessControl::accessToInt(value, property, uid, access);
-}
-
-bool VehiclePropertyAccessControlForTesting::updateOrCreate(int32_t uid, int32_t property, int32_t access) {
-      return VehiclePropertyAccessControl::updateOrCreate(uid, property, access);
-}
-
-bool VehiclePropertyAccessControlForTesting::populate(xmlNode* a_node) {
-      return VehiclePropertyAccessControl::populate(a_node);
-}
-
-bool VehiclePropertyAccessControlForTesting::process(const char* policy) {
-      return VehiclePropertyAccessControl::process(policy);
-}
-
-void VehiclePropertyAccessControlForTesting::emptyAccessControlMap() {
-    for (auto& i: VehiclePropertyAccessControl::mVehicleAccessControlMap) {
-        delete(&i);
-    }
-
-    VehiclePropertyAccessControl::mVehicleAccessControlMap.clear();
-}
-
-bool VehiclePropertyAccessControlForTesting::getAccessToProperty(int32_t property, std::map<int32_t, int32_t>** accessMap) {
-  if (mVehicleAccessControlMap.count(property) == 0) {
-    return false;
-  }
-
-  *accessMap = mVehicleAccessControlMap[property];
-  return true;
-}
-
-};
diff --git a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.h b/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.h
deleted file mode 100644
index 98ca548..0000000
--- a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlForTesting.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef CAR_VEHICLE_PROPERTY_ACCESS_CONTROL_MOCK_H_
-#define CAR_VEHICLE_PROPERTY_ACCESS_CONTROL_MOCK_H_
-
-#include <utils/String8.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <map>
-#include <string>
-#include <private/android_filesystem_config.h>
-#include <vehicle-internal.h>
-#include <VehiclePropertyAccessControl.h>
-
-namespace android {
-class VehiclePropertyAccessControlForTesting : public VehiclePropertyAccessControl {
-public:
-    bool isHexNotation(std::string const& s);
-    bool accessToInt(int32_t* const value,const xmlChar* property,
-                   const xmlChar* uid, const xmlChar* access);
-    bool updateOrCreate(int32_t uid, int32_t property, int32_t access);
-    bool populate(xmlNode* a_node);
-    bool process(const char* policy);
-    void emptyAccessControlMap();
-    bool getAccessToProperty(int32_t property, std::map<int32_t, int32_t>** accessMap);
-};
-};
-#endif
diff --git a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlTest.cpp b/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlTest.cpp
deleted file mode 100644
index 0ece6d1..0000000
--- a/tests/vehiclenetworkservice_unit_tests/VehiclePropertyAccessControlTest.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * 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 <unistd.h>
-
-#include <gtest/gtest.h>
-#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/SystemClock.h>
-#include <VehiclePropertyAccessControlForTesting.h>
-
-namespace android {
-
-class VehiclePropertyAccessControlTest : public testing::Test {
-public:
-    VehiclePropertyAccessControlTest() {}
-    ~VehiclePropertyAccessControlTest() {}
-
-public:
-    static std::string xmlData;
-    static std::string xmlData2;
-    static const int32_t prop1;
-    static const int32_t prop2;
-    static const int32_t prop3;
-    static const int32_t uid1;
-    static const int32_t uid2;
-    static const int32_t uid3;
-
-protected:
-    void SetUp() {}
-
-protected:
-    xmlDoc* doc;
-    VehiclePropertyAccessControlForTesting mVehiclePropertyAccessControl;
-};
-
-std::string VehiclePropertyAccessControlTest::xmlData =
-                            "<ALLOW>"
-                            "<PROPERTY name=\"PROP1\" value=\"0xA\">"
-                            "<UID name=\"UID1\" access=\"r\" value=\"1000\"/>"
-                            "</PROPERTY>"
-                            "<PROPERTY name=\"PROP2\" value=\"0xB\">"
-                            "<UID name=\"UID2\" access=\"w\" value=\"2000\"/>"
-                            "</PROPERTY>"
-                            "<PROPERTY name=\"PROP3\" value=\"0xC\">"
-                            "<UID name=\"UID3\" access=\"rw\" value=\"3000\"/>"
-                            "</PROPERTY>"
-                            "</ALLOW>";
-
-const int32_t VehiclePropertyAccessControlTest::prop1 = 0xa;
-const int32_t VehiclePropertyAccessControlTest::prop2 = 0xb;
-const int32_t VehiclePropertyAccessControlTest::prop3 = 0xc;
-const int32_t VehiclePropertyAccessControlTest::uid1 = 1000;
-const int32_t VehiclePropertyAccessControlTest::uid2 = 2000;
-const int32_t VehiclePropertyAccessControlTest::uid3 = 3000;
-
-TEST_F(VehiclePropertyAccessControlTest, isHexNotation) {
-    static const std::string shouldPass[] =
-        {"0x01234567",
-         "0x01abcdef",
-         "0x01ABCDEF",
-         "0x0"};
-
-    static const std::string shouldFail[] =
-        {"0",
-         "0x",
-         "01234567",
-         "ABCDEF01",
-         "0xabi"};
-
-    for(auto& h : shouldPass) {
-        ASSERT_TRUE(mVehiclePropertyAccessControl.isHexNotation(h));
-    }
-
-    for(auto& h : shouldFail) {
-        ASSERT_FALSE(mVehiclePropertyAccessControl.isHexNotation(h));
-    }
-}
-
-TEST_F(VehiclePropertyAccessControlTest, accessToInt) {
-    static const char* property = "property";
-    static const char* uid = "uid";
-    struct ShouldPassType {std::string str; int32_t value;};
-    static const struct ShouldPassType shouldPass[] = {
-            {"r", VEHICLE_PROP_ACCESS_READ},
-            {"w", VEHICLE_PROP_ACCESS_WRITE},
-            {"rw", VEHICLE_PROP_ACCESS_READ_WRITE},
-            {"wr", VEHICLE_PROP_ACCESS_READ_WRITE}
-    };
-    static const char* shouldFail[] = {"rr", "ww", "rww", "rwr", "", "k"};
-    int32_t value;
-
-    for(auto& h : shouldPass) {
-        ASSERT_TRUE(mVehiclePropertyAccessControl.accessToInt(&value,
-            (const xmlChar*)property, (const xmlChar*)uid,
-            (const xmlChar*)h.str.c_str()));
-        ASSERT_EQ(h.value, value);
-    }
-
-    for(auto& h : shouldFail) {
-        ASSERT_FALSE(mVehiclePropertyAccessControl.accessToInt(&value,
-            (const xmlChar*)property, (const xmlChar*)uid, (const xmlChar*)h));
-    }
-}
-
-TEST_F(VehiclePropertyAccessControlTest, updateOrCreate) {
-    std::map<int32_t, int32_t> *accessMap;
-
-    // Empty the map
-    mVehiclePropertyAccessControl.emptyAccessControlMap();
-
-    // Make sure the property does not exist
-    ASSERT_FALSE(mVehiclePropertyAccessControl.getAccessToProperty(prop1,
-                                                                   &accessMap));
-
-    // Create the property and give uid read access
-    ASSERT_FALSE(mVehiclePropertyAccessControl.updateOrCreate(uid1, prop1,
-                                                 VEHICLE_PROP_ACCESS_READ));
-
-    // Make sure the property was created
-    ASSERT_TRUE(mVehiclePropertyAccessControl.getAccessToProperty(prop1,
-                                                                   &accessMap));
-
-    // Make sure uid has read access to the property
-    ASSERT_EQ((*accessMap)[uid1], VEHICLE_PROP_ACCESS_READ);
-
-    // Give uid2 read/write access to the property
-    ASSERT_FALSE(mVehiclePropertyAccessControl.updateOrCreate(uid2, prop1,
-                                                VEHICLE_PROP_ACCESS_READ_WRITE));
-
-    // Get the accessMap
-    ASSERT_TRUE(mVehiclePropertyAccessControl.getAccessToProperty(prop1,
-                                                                   &accessMap));
-    // Make sure uid2 has read/write access to the property
-    ASSERT_EQ((*accessMap)[uid2], VEHICLE_PROP_ACCESS_READ_WRITE);
-
-    // Make sure uid still has read access to the property
-    ASSERT_EQ((*accessMap)[uid1], VEHICLE_PROP_ACCESS_READ);
-
-    // Change uid access to write for property
-    ASSERT_TRUE(mVehiclePropertyAccessControl.updateOrCreate(uid1, prop1,
-                                                     VEHICLE_PROP_ACCESS_WRITE));
-
-    // Get the accessMap
-    ASSERT_TRUE(mVehiclePropertyAccessControl.getAccessToProperty(prop1,
-                                                                   &accessMap));
-
-    // Make sure uid has write access to property
-    ASSERT_EQ((*accessMap)[uid1], VEHICLE_PROP_ACCESS_WRITE);
-
-    // Make sure uid2 has read write access to property
-    ASSERT_EQ((*accessMap)[uid2], VEHICLE_PROP_ACCESS_READ_WRITE);
-}
-
-TEST_F(VehiclePropertyAccessControlTest, populate) {
-    xmlNode* root_element;
-    std::map<int32_t, int32_t> *accessMap;
-
-    // Empty the map
-    mVehiclePropertyAccessControl.emptyAccessControlMap();
-
-    doc = xmlReadMemory(xmlData.c_str(), xmlData.length(), NULL, NULL, 0);
-    ASSERT_TRUE(doc != NULL);
-    root_element = xmlDocGetRootElement(doc);
-    ASSERT_TRUE(root_element != NULL);
-
-    bool result = mVehiclePropertyAccessControl.populate(root_element->children);
-
-    ASSERT_TRUE(result);
-
-    // Get the accessMap
-    ASSERT_TRUE(mVehiclePropertyAccessControl.getAccessToProperty(prop1,
-                                                                  &accessMap));
-
-    // Make sure uid still has read access to the property
-    ASSERT_EQ((*accessMap)[uid1], VEHICLE_PROP_ACCESS_READ);
-
-    // Get the accessMap
-    ASSERT_TRUE(mVehiclePropertyAccessControl.getAccessToProperty(prop2,
-                                                                  &accessMap));
-
-    // Make sure uid still has write access to the property
-    ASSERT_EQ((*accessMap)[uid2], VEHICLE_PROP_ACCESS_WRITE);
-
-    ASSERT_TRUE(mVehiclePropertyAccessControl.testAccess(prop1, uid1, 0));
-    ASSERT_FALSE(mVehiclePropertyAccessControl.testAccess(prop1, uid1, 1));
-    ASSERT_TRUE(mVehiclePropertyAccessControl.testAccess(prop2, uid2, 1));
-    ASSERT_FALSE(mVehiclePropertyAccessControl.testAccess(prop2, uid2, 0));
-    ASSERT_TRUE(mVehiclePropertyAccessControl.testAccess(prop3, uid3, 1));
-    ASSERT_TRUE(mVehiclePropertyAccessControl.testAccess(prop3, uid3, 0));
-
-    static const std::string dump_msg =
-            "UID 1000: property 0x0000000a, access read\n"
-            "UID 2000: property 0x0000000b, access write\n"
-            "UID 3000: property 0x0000000c, access read/write\n";
-
-    String8 msg;
-    mVehiclePropertyAccessControl.dump(msg);
-
-    ASSERT_EQ(dump_msg.compare(msg.string()), 0);
-
-}
-
-TEST_F(VehiclePropertyAccessControlTest, init) {
-    xmlFreeDoc(doc);
-    xmlCleanupParser();
-    // Empty the map
-    mVehiclePropertyAccessControl.emptyAccessControlMap();
-    ASSERT_TRUE(mVehiclePropertyAccessControl.init());
-}
-}; // namespace android
diff --git a/tools/vns_policy_gen.py b/tools/vns_policy_gen.py
deleted file mode 100755
index 298e7ed..0000000
--- a/tools/vns_policy_gen.py
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-"""Generate vns_policy.xml from vehicle.h"""
-import os
-import re
-import sys
-import datetime
-
-curYear = datetime.datetime.now().year
-
-
-XML_HEADER = \
-"""<!-- Copyright (C) """ + str(curYear) + """ 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.
-    /
-
-    //Autogenerated from vehicle.h using tools/vns_policy_gen.py.
-    //Do not modify manually.
--->
-
-<ALLOW>
-  <PROPERTY name="VEHICLE_PROPERTY_INVALID" value = "0x0">
-    <!--  Property 0 write is used to allow hal mocking -->
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-    <UID name="AID_AUDIOSERVER" access="r" value="1041"/>
-  </PROPERTY>
-
-"""
-
-XML_TRAIL = \
-"""</ALLOW>
-"""
-
-RE_PROPERTY_PATTERN = r'/\*\*(.*?)\*/\n\#define\s+VEHICLE_PROPERTY_(\S+)\s+(\(0x\S+\))'
-AUDIOSERVER_RO_PARAMS = ['VEHICLE_PROPERTY_AUDIO_FOCUS']
-AUDIOSERVER_WO_PARAMS = ['VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE']
-NO_AUTO_GET_PARAMS = ['VEHICLE_PROPERTY_AUDIO_VOLUME', 'VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT']
-
-class PropertyInfo(object):
-  def __init__(self, value, name):
-    self.value = value
-    self.name = name
-    self.type = ""
-    self.changeMode = ""
-    self.access = ""
-    self.unit = ""
-    self.startEnd = 0 # _START/END property
-    self.aid_audioserver = ""
-    self.no_auto_get = 0
-    # Check if this property requires special handling
-    if name in AUDIOSERVER_RO_PARAMS:
-      self.aid_audioserver = 'r'
-    if name in AUDIOSERVER_WO_PARAMS:
-      self.aid_audioserver = 'w'
-    if name in NO_AUTO_GET_PARAMS:
-      self.no_auto_get = 1
-
-def printProperties(props, f):
-  for p in props:
-    if p.startEnd == 0:
-      if p.no_auto_get == 0:
-        f.write("""  <PROPERTY name=\"""" + p.name + "\" value=\"" + p.value + "\">\n")
-      else:
-          f.write("""  <PROPERTY name=\"""" + p.name + "\" value=\"" + p.value + """" no_auto_get="true">\n""")
-      f.write("""    <UID name="AID_SYSTEM" access=\"""" + p.access + """" value="1000"/>\n""")
-      if p.aid_audioserver:
-        f.write("""    <UID name="AID_AUDIOSERVER" access=\"""" + p.aid_audioserver + """" value="1041"/>\n""")
-      f.write("  </PROPERTY>\n\n")
-    elif p.name == 'VEHICLE_PROPERTY_INTERNAL_START':
-      f.write("<!-- Internal Vehicle Properties -->\n\n")
-
-def main(argv):
-  # If user hasn't called build/envsetup.sh, use relative path
-  base_path = os.getenv('ANDROID_BUILD_TOP', "../../../..")
-
-  # Parse vehicle.h file
-  vehicle_h_path = base_path + "/hardware/libhardware/include/hardware/vehicle.h"
-  #print vehicle_h_path
-  f = open(vehicle_h_path, 'r')
-  text = f.read()
-  f.close()
-
-  # Parse vehicle_internal.h
-  vehicle_internal_h_path = base_path + "/packages/services/Car/libvehiclenetwork/include/vehicle-internal.h"
-  f = open(vehicle_internal_h_path, 'r')
-  text = text + f.read()
-  f.close()
-
-  # Open the vns_policy.xml file
-  vns_policy_path = base_path + "/packages/services/Car/vns_policy/vns_policy.xml"
-  f = open(vns_policy_path, 'w')
-
-  props = []
-  property_re = re.compile(RE_PROPERTY_PATTERN, re.MULTILINE | re.DOTALL)
-  for match in property_re.finditer(text):
-    words = match.group(1).split()
-    name = "VEHICLE_PROPERTY_" + match.group(2)
-    value = match.group(3)
-    if (value[0] == "(" and value[-1] == ")"):
-      value = value[1:-1]
-    prop = PropertyInfo(value, name)
-    i = 0
-    while i < len(words):
-      if words[i] == "@access":
-        i += 1
-        if words[i].find("READ") > 0:
-          if words[i].find("WRITE") > 0:
-            prop.access = 'rw'
-          else:
-            prop.access = 'r'
-        else:
-          prop.access = 'w'
-      elif words[i] == "@range_start" or words[i] == "@range_end":
-        prop.startEnd = 1
-      i += 1
-    props.append(prop)
-    #print prop
-
-  f.write(XML_HEADER)
-  printProperties(props, f)
-  f.write(XML_TRAIL)
-
-if __name__ == '__main__':
-  main(sys.argv)
-
diff --git a/vehicle_network_service/Android.mk b/vehicle_network_service/Android.mk
deleted file mode 100644
index a0a135f..0000000
--- a/vehicle_network_service/Android.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (C) 2015 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_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
-    find . -name "*.cpp" -and -not -name ".*")) \
-    InternalPropertyDef.c
-LOCAL_SRC_FILES := $(filter-out main_vehiclenetwork.cpp, $(LOCAL_SRC_FILES))
-
-LOCAL_C_INCLUDES += \
-    frameworks/base/include \
-    packages/services/Car/libvehiclenetwork/include \
-    external/libxml2/include \
-    external/icu/icu4c/source/common
-
-LOCAL_SHARED_LIBRARIES := \
-    libbinder
-
-LOCAL_MODULE := libvehiclenetworkservice
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS  += -Werror
-
-include $(BUILD_STATIC_LIBRARY)
-
-##################################
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    main_vehiclenetwork.cpp
-
-LOCAL_C_INCLUDES += \
-    frameworks/base/include \
-    packages/services/Car/libvehiclenetwork/include \
-    external/libxml2/include \
-    external/icu/icu4c/source/common
-
-LOCAL_SHARED_LIBRARIES := \
-    libbinder \
-    liblog \
-    libutils \
-    libhardware \
-    libvehiclenetwork-native \
-    libcutils \
-    libxml2
-
-LOCAL_WHOLE_STATIC_LIBRARIES := \
-    libvehiclenetworkservice
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-LOCAL_MODULE := vehicle_network_service
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS  += -Werror
-
-include $(BUILD_EXECUTABLE)
diff --git a/vehicle_network_service/InternalPropertyDef.c b/vehicle_network_service/InternalPropertyDef.c
deleted file mode 100644
index 637f88c..0000000
--- a/vehicle_network_service/InternalPropertyDef.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2015 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 <stdint.h>
-#include <sys/types.h>
-
-#include <vehicle-internal.h>
-
-static vehicle_prop_config_t INTERNAL_PROPERTIES[] = {
-    {
-        .prop = VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE,
-        .access = VEHICLE_PROP_ACCESS_READ_WRITE,
-        .change_mode = VEHICLE_PROP_CHANGE_MODE_ON_CHANGE,
-        .value_type = VEHICLE_VALUE_TYPE_INT32_VEC2,
-        .min_sample_rate = 0,
-        .max_sample_rate = 0,
-        .hal_data = NULL,
-    },
-};
-
-vehicle_prop_config_t const * getInternalProperties() {
-    return INTERNAL_PROPERTIES;
-}
-
-int getNumInternalProperties() {
-    return sizeof(INTERNAL_PROPERTIES) / sizeof(vehicle_prop_config_t);
-}
diff --git a/vehicle_network_service/VehicleHalPropertyUtil.h b/vehicle_network_service/VehicleHalPropertyUtil.h
deleted file mode 100644
index 1731969..0000000
--- a/vehicle_network_service/VehicleHalPropertyUtil.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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 CAR_VEHICLE_HAL_PROPERTY_UTIL_H_
-#define CAR_VEHICLE_HAL_PROPERTY_UTIL_H_
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <inttypes.h>
-
-#include <hardware/hardware.h>
-#include <hardware/vehicle.h>
-
-#include <utils/String8.h>
-
-#include <IVehicleNetwork.h>
-
-namespace android {
-
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-
-class VechilePropertyUtil {
-public:
-    static void dumpProperty(String8& msg, const vehicle_prop_config_t& config) {
-        msg.appendFormat("property 0x%x, access:0x%x, change_mode:0x%x, value_type:0x%x",
-                config.prop, config.access, config.change_mode, config.value_type);
-        char configString[100];
-        if (config.config_string.len > 0 && config.config_string.data != NULL) {
-            int stringLen = MIN(config.config_string.len, (int32_t) sizeof(configString) - 1);
-            memcpy(configString, config.config_string.data, stringLen);
-            configString[stringLen] = 0;
-        }
-        msg.appendFormat(",permission:0x%x, zones:0x%x, conflg_flag:0x%x, config_string:%s, " \
-                "fsmin:%f, fsmax:%f",
-                config.permission_model, config.vehicle_zone_flags, config.config_flags,
-                (config.config_string.len > 0) ? configString : "N/A",
-                config.min_sample_rate, config.max_sample_rate);
-        switch (config.value_type) {
-            case VEHICLE_VALUE_TYPE_FLOAT:
-            case VEHICLE_VALUE_TYPE_FLOAT_VEC2:
-            case VEHICLE_VALUE_TYPE_FLOAT_VEC3:
-            case VEHICLE_VALUE_TYPE_FLOAT_VEC4: {
-                msg.appendFormat(",v min:%f, v max:%f\n", config.float_min_value,
-                        config.float_max_value);
-            } break;
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-            case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4: {
-                if (config.float_min_values == NULL) {
-                    if (config.float_max_values == NULL) {
-                        msg.appendFormat(",v min:%f, v max:%f\n", config.float_min_value,
-                                config.float_max_value);
-                    } else {
-                        msg.appendFormat(", ERROR: float_max_values not NULL while min is NULL");
-
-                    }
-                } else {
-                    if (config.float_max_values == NULL) {
-                        msg.appendFormat(", ERROR: float_min_values not NULL while max is NULL");
-                    } else {
-                        int n = VehicleNetworkUtil::countNumberOfZones(
-                                config.vehicle_zone_flags);
-                        msg.appendFormat(", v min:");
-                        for (int i = 0; i < n; i++) {
-                            msg.appendFormat("%f,", config.float_min_values[i]);
-                        }
-                        msg.appendFormat(", v max:");
-                        for (int i = 0; i < n; i++) {
-                            msg.appendFormat("%f,", config.float_max_values[i]);
-                        }
-                    }
-                }
-            } break;
-            case VEHICLE_VALUE_TYPE_INT64: {
-                msg.appendFormat(",v min:%" PRId64 " max:%" PRId64 "\n", config.int64_min_value,
-                        config.int64_max_value);
-            } break;
-            case VEHICLE_VALUE_TYPE_INT32:
-            case VEHICLE_VALUE_TYPE_INT32_VEC2:
-            case VEHICLE_VALUE_TYPE_INT32_VEC3:
-            case VEHICLE_VALUE_TYPE_INT32_VEC4: {
-                msg.appendFormat(",v min:%d, v max:%d\n", config.int32_min_value,
-                        config.int32_max_value);
-            } break;
-            case VEHICLE_VALUE_TYPE_ZONED_INT32:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-            case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4: {
-                if (config.int32_min_values == NULL) {
-                    if (config.int32_max_values == NULL) {
-                        msg.appendFormat(",v min:%d, v max:%d\n", config.int32_min_value,
-                                config.int32_max_value);
-                    } else {
-                        msg.appendFormat(", ERROR: int32_max_values not NULL while min is NULL");
-
-                    }
-                } else {
-                    if (config.int32_max_values == NULL) {
-                        msg.appendFormat(", ERROR: int32_min_values not NULL while max is NULL");
-                    } else {
-                        int n = VehicleNetworkUtil::countNumberOfZones(
-                                config.vehicle_zone_flags);
-                        msg.appendFormat(", v min:");
-                        for (int i = 0; i < n; i++) {
-                            msg.appendFormat("%d,", config.int32_min_values[i]);
-                        }
-                        msg.appendFormat(", v max:");
-                        for (int i = 0; i < n; i++) {
-                            msg.appendFormat("%d,", config.int32_max_values[i]);
-                        }
-                    }
-                }
-            } break;
-            default:
-                msg.appendFormat("\n");
-        }
-    }
-};
-
-
-};
-
-#endif /* CAR_VEHICLE_HAL_PROPERTY_UTIL_H_ */
diff --git a/vehicle_network_service/VehicleNetworkService.cpp b/vehicle_network_service/VehicleNetworkService.cpp
deleted file mode 100644
index 4311a67..0000000
--- a/vehicle_network_service/VehicleNetworkService.cpp
+++ /dev/null
@@ -1,1406 +0,0 @@
-/*
- * 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 "VehicleNetwork"
-
-#include <binder/PermissionCache.h>
-#include <utils/Errors.h>
-#include <utils/SystemClock.h>
-
-#include <private/android_filesystem_config.h>
-
-#include <vehicle-internal.h>
-
-#include "VehicleHalPropertyUtil.h"
-#include "VehicleNetworkService.h"
-
-//#define DBG_MEM_LEAK
-//#define DBG_EVENT
-//#define DBG_VERBOSE
-#ifdef DBG_EVENT
-#define EVENT_LOG(x...) ALOGD(x)
-#else
-#define EVENT_LOG(x...)
-#endif
-#ifdef DBG_VERBOSE
-#define LOG_VERBOSE(x...) ALOGD(x)
-#else
-#define LOG_VERBOSE(x...)
-#endif
-
-namespace android {
-
-#ifdef DBG_MEM_LEAK
-// copied from frameworks/base/core/jni/android_os_Debug.cpp
-
-extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
-    size_t* infoSize, size_t* totalMemory, size_t* backtraceSize);
-extern "C" void free_malloc_leak_info(uint8_t* info);
-#define SIZE_FLAG_ZYGOTE_CHILD  (1<<31)
-#define BACKTRACE_SIZE          32
-
-static size_t gNumBacktraceElements;
-
-/*
- * This is a qsort() callback.
- *
- * See dumpNativeHeap() for comments about the data format and sort order.
- */
-static int compareHeapRecords(const void* vrec1, const void* vrec2)
-{
-    const size_t* rec1 = (const size_t*) vrec1;
-    const size_t* rec2 = (const size_t*) vrec2;
-    size_t size1 = *rec1;
-    size_t size2 = *rec2;
-
-    if (size1 < size2) {
-        return 1;
-    } else if (size1 > size2) {
-        return -1;
-    }
-
-    uintptr_t* bt1 = (uintptr_t*)(rec1 + 2);
-    uintptr_t* bt2 = (uintptr_t*)(rec2 + 2);
-    for (size_t idx = 0; idx < gNumBacktraceElements; idx++) {
-        uintptr_t addr1 = bt1[idx];
-        uintptr_t addr2 = bt2[idx];
-        if (addr1 == addr2) {
-            if (addr1 == 0)
-                break;
-            continue;
-        }
-        if (addr1 < addr2) {
-            return -1;
-        } else if (addr1 > addr2) {
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
-static void dumpNativeHeap(String8& msg)
-{
-    uint8_t* info = NULL;
-    size_t overallSize, infoSize, totalMemory, backtraceSize;
-
-    get_malloc_leak_info(&info, &overallSize, &infoSize, &totalMemory,
-        &backtraceSize);
-    if (info == NULL) {
-        msg.appendFormat("Native heap dump not available. To enable, run these"
-                    " commands (requires root):\n");
-        msg.appendFormat("# adb shell stop\n");
-        msg.appendFormat("# adb shell setprop libc.debug.malloc.options "
-                    "backtrace\n");
-        msg.appendFormat("# adb shell start\n");
-        return;
-    }
-
-    msg.appendFormat("Android Native Heap Dump v1.0\n\n");
-
-    size_t recordCount = overallSize / infoSize;
-    msg.appendFormat("Total memory: %zu\n", totalMemory);
-    msg.appendFormat("Allocation records: %zd\n", recordCount);
-    msg.appendFormat("\n");
-
-    /* re-sort the entries */
-    gNumBacktraceElements = backtraceSize;
-    qsort(info, recordCount, infoSize, compareHeapRecords);
-
-    /* dump the entries to the file */
-    const uint8_t* ptr = info;
-    for (size_t idx = 0; idx < recordCount; idx++) {
-        size_t size = *(size_t*) ptr;
-        size_t allocations = *(size_t*) (ptr + sizeof(size_t));
-        uintptr_t* backtrace = (uintptr_t*) (ptr + sizeof(size_t) * 2);
-
-        msg.appendFormat("z %d  sz %8zu  num %4zu  bt",
-                (size & SIZE_FLAG_ZYGOTE_CHILD) != 0,
-                size & ~SIZE_FLAG_ZYGOTE_CHILD,
-                allocations);
-        for (size_t bt = 0; bt < backtraceSize; bt++) {
-            if (backtrace[bt] == 0) {
-                break;
-            } else {
-#ifdef __LP64__
-                msg.appendFormat(" %016" PRIxPTR, backtrace[bt]);
-#else
-                msg.appendFormat(" %08" PRIxPTR, backtrace[bt]);
-#endif
-            }
-        }
-        msg.appendFormat("\n");
-
-        ptr += infoSize;
-    }
-
-    free_malloc_leak_info(info);
-
-    msg.appendFormat("MAPS\n");
-    const char* maps = "/proc/self/maps";
-    FILE* in = fopen(maps, "r");
-    if (in == NULL) {
-        msg.appendFormat("Could not open %s\n", maps);
-        return;
-    }
-    char buf[BUFSIZ];
-    while (size_t n = fread(buf, sizeof(char), BUFSIZ, in)) {
-        msg.append(buf, n);
-    }
-    fclose(in);
-
-    msg.appendFormat("END\n");
-}
-#endif
-
-// ----------------------------------------------------------------------------
-
-VehicleHalMessageHandler::VehicleHalMessageHandler(const sp<Looper>& looper,
-        VehicleNetworkService& service)
-    : mLooper(looper),
-      mService(service),
-      mFreeListIndex(0),
-      mLastDispatchTime(0) {
-}
-
-VehicleHalMessageHandler::~VehicleHalMessageHandler() {
-    Mutex::Autolock autoLock(mLock);
-    for (int i = 0; i < NUM_PROPERTY_EVENT_LISTS; i++) {
-        for (auto& e : mHalPropertyList[i]) {
-            VehiclePropValueUtil::deleteVehiclePropValue(e);
-        }
-    }
-    for (VehicleHalError* e : mHalErrors) {
-        delete e;
-    }
-}
-
-static const int MS_TO_NS = 1000000;
-
-void VehicleHalMessageHandler::handleHalEvent(vehicle_prop_value_t *eventData) {
-    EVENT_LOG("handleHalEvent 0x%x", eventData->prop);
-    Mutex::Autolock autoLock(mLock);
-    List<vehicle_prop_value_t*>& propList = mHalPropertyList[mFreeListIndex];
-    propList.push_back(eventData);
-    int64_t deltaFromLast = elapsedRealtime() - mLastDispatchTime;
-    if (deltaFromLast > DISPATCH_INTERVAL_MS) {
-        mLooper->sendMessage(this, Message(HAL_EVENT));
-    } else {
-        mLooper->sendMessageDelayed((DISPATCH_INTERVAL_MS - deltaFromLast) * MS_TO_NS,
-                this, Message(HAL_EVENT));
-    }
-}
-
-void VehicleHalMessageHandler::handleHalError(VehicleHalError* error) {
-    Mutex::Autolock autoLock(mLock);
-    mHalErrors.push_back(error);
-    mLooper->sendMessage(this, Message(HAL_ERROR));
-}
-
-void VehicleHalMessageHandler::handleMockStateChange() {
-    Mutex::Autolock autoLock(mLock);
-    for (int i = 0; i < 2; i++) {
-        for (auto& e : mHalPropertyList[i]) {
-            VehiclePropValueUtil::deleteVehiclePropValue(e);
-        }
-        mHalPropertyList[i].clear();
-    }
-    sp<MessageHandler> self(this);
-    mLooper->removeMessages(self);
-}
-
-void VehicleHalMessageHandler::doHandleHalEvent() {
-    // event dispatching can take time, so do it outside lock and that requires double buffering.
-    // inside lock, free buffer is swapped with non-free buffer.
-    List<vehicle_prop_value_t*>* events = NULL;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        mLastDispatchTime = elapsedRealtime();
-        int nonFreeListIndex = mFreeListIndex ^ 0x1;
-        List<vehicle_prop_value_t*>* nonFreeList = &(mHalPropertyList[nonFreeListIndex]);
-        List<vehicle_prop_value_t*>* freeList = &(mHalPropertyList[mFreeListIndex]);
-        if (nonFreeList->size() > 0) {
-            for (auto& e : *freeList) {
-                nonFreeList->push_back(e);
-            }
-            freeList->clear();
-            events = nonFreeList;
-        } else if (freeList->size() > 0) {
-            events = freeList;
-            mFreeListIndex = nonFreeListIndex;
-        }
-    } while (false);
-    if (events != NULL) {
-        EVENT_LOG("doHandleHalEvent, num events:%d", events->size());
-        mService.dispatchHalEvents(*events);
-        //TODO implement return to memory pool
-        for (auto& e : *events) {
-            VehiclePropValueUtil::deleteVehiclePropValue(e);
-        }
-        events->clear();
-    }
-}
-
-void VehicleHalMessageHandler::doHandleHalError() {
-    VehicleHalError* error = NULL;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mHalErrors.size() > 0) {
-            auto itr = mHalErrors.begin();
-            error = *itr;
-            mHalErrors.erase(itr);
-        }
-    } while (false);
-    if (error != NULL) {
-        mService.dispatchHalError(error);
-    }
-}
-
-void VehicleHalMessageHandler::handleMessage(const Message& message) {
-    switch (message.what) {
-    case HAL_EVENT:
-        doHandleHalEvent();
-        break;
-    case HAL_ERROR:
-        doHandleHalError();
-        break;
-    }
-}
-
-void VehicleHalMessageHandler::dump(String8& msg) {
-    msg.appendFormat("mFreeListIndex:%d, mLastDispatchTime:%" PRId64 "\n",
-                     mFreeListIndex, mLastDispatchTime);
-}
-
-// ----------------------------------------------------------------------------
-
-void MockDeathHandler::binderDied(const wp<IBinder>& who) {
-    mService.handleHalMockDeath(who);
-}
-
-// ----------------------------------------------------------------------------
-
-PropertyValueCache::PropertyValueCache() {
-
-}
-
-PropertyValueCache::~PropertyValueCache() {
-    for (size_t i = 0; i < mCache.size(); i++) {
-        vehicle_prop_value_t* v = mCache.editValueAt(i);
-        VehiclePropValueUtil::deleteVehiclePropValue(v);
-    }
-    mCache.clear();
-}
-
-void PropertyValueCache::writeToCache(const vehicle_prop_value_t& value) {
-    vehicle_prop_value_t* v;
-    ssize_t index = mCache.indexOfKey(value.prop);
-    if (index < 0) {
-        v = VehiclePropValueUtil::allocVehiclePropValue(value);
-        ASSERT_OR_HANDLE_NO_MEMORY(v, return);
-        mCache.add(value.prop, v);
-    } else {
-        v = mCache.editValueAt(index);
-        VehiclePropValueUtil::copyVehiclePropValue(v, value, true /* deleteOldData */);
-    }
-}
-
-bool PropertyValueCache::readFromCache(vehicle_prop_value_t* value) {
-    ssize_t index = mCache.indexOfKey(value->prop);
-    if (index < 0) {
-        ALOGE("readFromCache 0x%x, not found", value->prop);
-        return false;
-    }
-    const vehicle_prop_value_t* cached = mCache.valueAt(index);
-    status_t r = VehiclePropValueUtil::copyVehiclePropValue(value, *cached);
-    if (r != NO_ERROR) {
-        ALOGD("readFromCache 0x%x, copy failed %d", value->prop, r);
-        return false;
-    }
-    return true;
-}
-
-// ----------------------------------------------------------------------------
-
-
-VehicleNetworkService* VehicleNetworkService::sInstance = NULL;
-
-status_t VehicleNetworkService::dump(int fd, const Vector<String16>& /*args*/) {
-    static const String16 sDump("android.permission.DUMP");
-    String8 msg;
-    if (!PermissionCache::checkCallingPermission(sDump)) {
-        msg.appendFormat("Permission Denial: "
-                    "can't dump VNS from pid=%d, uid=%d\n",
-                    IPCThreadState::self()->getCallingPid(),
-                    IPCThreadState::self()->getCallingUid());
-        write(fd, msg.string(), msg.size());
-        return NO_ERROR;
-    }
-#ifdef DBG_MEM_LEAK
-    dumpNativeHeap(msg);
-#endif
-    msg.appendFormat("MockingEnabled=%d\n", mMockingEnabled ? 1 : 0);
-    msg.appendFormat("*Handler, now in ms:%" PRId64 "\n", elapsedRealtime());
-    mHandler->dump(msg);
-    msg.append("*Properties\n");
-    for (auto& prop : mProperties->getList()) {
-        VechilePropertyUtil::dumpProperty(msg, *prop);
-    }
-    if (mMockingEnabled) {
-        msg.append("*Mocked Properties\n");
-        for (auto& prop : mPropertiesForMocking->getList()) {
-            msg.appendFormat("property 0x%x\n", prop->prop);
-        }
-    }
-    msg.append("*Active clients*\n");
-    for (size_t i = 0; i < mBinderToClientMap.size(); i++) {
-        mBinderToClientMap.valueAt(i)->dump(msg);
-    }
-    msg.append("*Active clients per property*\n");
-    for (size_t i = 0; i < mPropertyToClientsMap.size(); i++) {
-        msg.appendFormat("prop 0x%x, pids:", mPropertyToClientsMap.keyAt(i));
-        sp<HalClientSpVector> clients = mPropertyToClientsMap.valueAt(i);
-        for (size_t j = 0; j < clients->size(); j++) {
-            msg.appendFormat("%d,", clients->itemAt(j)->getPid());
-        }
-        msg.append("\n");
-    }
-    msg.append("*Subscription info per property*\n");
-    for (size_t i = 0; i < mSubscriptionInfos.size(); i++) {
-        const SubscriptionInfo& info = mSubscriptionInfos.valueAt(i);
-        msg.appendFormat("prop 0x%x, sample rate %f Hz, zones 0x%x, flags: 0x%x\n",
-                         mSubscriptionInfos.keyAt(i), info.sampleRate, info.zones, info.flags);
-    }
-    msg.appendFormat("*Event info per property, now in ns:%" PRId64 " *\n", elapsedRealtimeNano());
-    for (size_t i = 0; i < mEventInfos.size(); i++) {
-        const EventInfo& info = mEventInfos.valueAt(i);
-        msg.appendFormat("prop 0x%x, event counts:%d, last timestamp: %" PRId64 "\n",
-                mEventInfos.keyAt(i), info.eventCount, info.lastTimestamp);
-    }
-    msg.appendFormat(" Events dropped while in mocking:%d, last dropped time %" PRId64 "\n",
-                     mDroppedEventsWhileInMocking, mLastEventDropTimeWhileInMocking);
-    msg.append("*Vehicle Network Service Permissions*\n");
-    mVehiclePropertyAccessControl.dump(msg);
-    msg.append("*Vehicle HAL dump*\n");
-    write(fd, msg.string(), msg.size());
-    mDevice->dump(mDevice, fd);
-    return NO_ERROR;
-}
-
-bool VehicleNetworkService::isOperationAllowed(int32_t property, bool isWrite) {
-    const uid_t uid = IPCThreadState::self()->getCallingUid();
-
-    bool allowed = mVehiclePropertyAccessControl.testAccess(property, uid, isWrite);
-    if (!allowed) {
-        ALOGW("Property 0x%x: access not allowed for uid %d, isWrite %d", property, uid, isWrite);
-    }
-    return allowed;
-}
-
-VehicleNetworkService::VehicleNetworkService()
-    : mModule(NULL),
-      mPropertiesSubscribedToSetCall(0),
-      mMockingEnabled(false),
-      mDroppedEventsWhileInMocking(0),
-      mLastEventDropTimeWhileInMocking(0){
-    sInstance = this;
-
-   // Load vehicle network services policy file
-   if(!mVehiclePropertyAccessControl.init()) {
-     LOG_ALWAYS_FATAL("Vehicle property access policy could not be initialized.");
-   }
-}
-
-VehicleNetworkService::~VehicleNetworkService() {
-    sInstance = NULL;
-    for (size_t i = 0; i < mPropertyToClientsMap.size(); i++) {
-        sp<HalClientSpVector> clients = mPropertyToClientsMap.editValueAt(i);
-        clients->clear();
-    }
-    mBinderToClientMap.clear();
-    mPropertyToClientsMap.clear();
-    mSubscriptionInfos.clear();
-}
-
-void VehicleNetworkService::binderDied(const wp<IBinder>& who) {
-    List<int32_t> propertiesToUnsubscribe;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        sp<IBinder> ibinder = who.promote();
-        ibinder->unlinkToDeath(this);
-        ssize_t index = mBinderToClientMap.indexOfKey(ibinder);
-        if (index < 0) {
-            // already removed. ignore
-            return;
-        }
-        sp<HalClient> currentClient = mBinderToClientMap.editValueAt(index);
-        ALOGW("client binder death, pid: %d, uid:%d", currentClient->getPid(),
-                currentClient->getUid());
-        mBinderToClientMap.removeItemsAt(index);
-
-        for (size_t i = 0; i < mPropertyToClientsMap.size(); i++) {
-            sp<HalClientSpVector>& clients = mPropertyToClientsMap.editValueAt(i);
-            clients->remove(currentClient);
-            if (clients->size() == 0) {
-                int32_t property = mPropertyToClientsMap.keyAt(i);
-                propertiesToUnsubscribe.push_back(property);
-                mSubscriptionInfos.removeItem(property);
-            }
-        }
-        for (int32_t property : propertiesToUnsubscribe) {
-            mPropertyToClientsMap.removeItem(property);
-        }
-    } while (false);
-    for (int32_t property : propertiesToUnsubscribe) {
-        mDevice->unsubscribe(mDevice, property);
-    }
-}
-
-void VehicleNetworkService::handleHalMockDeath(const wp<IBinder>& who) {
-    ALOGE("Hal mock binder died");
-    sp<IBinder> ibinder = who.promote();
-    stopMocking(IVehicleNetworkHalMock::asInterface(ibinder));
-}
-
-int VehicleNetworkService::eventCallback(const vehicle_prop_value_t *eventData) {
-    EVENT_LOG("eventCallback 0x%x");
-    sInstance->onHalEvent(eventData);
-    return NO_ERROR;
-}
-
-int VehicleNetworkService::errorCallback(int32_t errorCode, int32_t property, int32_t operation) {
-    status_t r = sInstance->onHalError(errorCode, property, operation);
-    if (r != NO_ERROR) {
-        ALOGE("VehicleNetworkService::errorCallback onHalError failed with %d", r);
-    }
-    return NO_ERROR;
-}
-
-extern "C" {
-vehicle_prop_config_t const * getInternalProperties();
-int getNumInternalProperties();
-};
-
-void VehicleNetworkService::onFirstRef() {
-    Mutex::Autolock autoLock(mLock);
-    status_t r = loadHal();
-    if (r!= NO_ERROR) {
-        ALOGE("cannot load HAL, error:%d", r);
-        return;
-    }
-    mHandlerThread = new HandlerThread();
-    r = mHandlerThread->start("HAL.NATIVE_LOOP");
-    if (r != NO_ERROR) {
-        ALOGE("cannot start handler thread, error:%d", r);
-        return;
-    }
-    sp<VehicleHalMessageHandler> handler(new VehicleHalMessageHandler(mHandlerThread->getLooper(),
-            *this));
-    ASSERT_ALWAYS_ON_NO_MEMORY(handler.get());
-    mHandler = handler;
-
-    // populate empty list before hal init.
-    mProperties = new VehiclePropertiesHolder(false /* deleteConfigsInDestructor */);
-    ASSERT_ALWAYS_ON_NO_MEMORY(mProperties);
-
-    r = mDevice->init(mDevice, eventCallback, errorCallback);
-    if (r != NO_ERROR) {
-        ALOGE("HAL init failed:%d", r);
-        return;
-    }
-    int numConfigs = 0;
-    vehicle_prop_config_t const* configs = mDevice->list_properties(mDevice, &numConfigs);
-    for (int i = 0; i < numConfigs; i++) {
-        mProperties->getList().push_back(&configs[i]);
-    }
-    configs = getInternalProperties();
-    for (int i = 0; i < getNumInternalProperties(); i++) {
-        mProperties->getList().push_back(&configs[i]);
-    }
-}
-
-void VehicleNetworkService::release() {
-    do {
-        Mutex::Autolock autoLock(mLock);
-        mHandlerThread->quit();
-    } while (false);
-    mDevice->release(mDevice);
-}
-
-vehicle_prop_config_t const * VehicleNetworkService::findConfigLocked(int32_t property) {
-    // TODO: this method is called on every get/set, consider to use hash map.
-    for (auto& config : (mMockingEnabled ?
-            mPropertiesForMocking->getList() : mProperties->getList())) {
-        if (config->prop == property) {
-            return config;
-        }
-    }
-    ALOGW("property not found 0x%x", property);
-    return NULL;
-}
-
-bool VehicleNetworkService::isGettableLocked(int32_t property) {
-    vehicle_prop_config_t const * config = findConfigLocked(property);
-    if (config == NULL) {
-        return false;
-    }
-    if ((config->access & VEHICLE_PROP_ACCESS_READ) == 0) {
-        ALOGI("cannot get, property 0x%x is write only", property);
-        return false;
-    }
-    return true;
-}
-
-bool VehicleNetworkService::isSettableLocked(int32_t property, int32_t valueType) {
-    vehicle_prop_config_t const * config = findConfigLocked(property);
-    if (config == NULL) {
-        return false;
-    }
-    if ((config->access & VEHICLE_PROP_ACCESS_WRITE) == 0) {
-        ALOGI("cannot set, property 0x%x is read only", property);
-        return false;
-    }
-    if (config->value_type != valueType) {
-        ALOGW("cannot set, property 0x%x expects type 0x%x while got 0x%x", property,
-                config->value_type, valueType);
-        return false;
-    }
-    return true;
-}
-
-bool VehicleNetworkService::isSubscribableLocked(int32_t property) {
-    vehicle_prop_config_t const * config = findConfigLocked(property);
-    if (config == NULL) {
-        return false;
-    }
-    if ((config->access & VEHICLE_PROP_ACCESS_READ) == 0) {
-        ALOGI("cannot subscribe, property 0x%x is write only", property);
-        return false;
-    }
-    if (config->change_mode == VEHICLE_PROP_CHANGE_MODE_STATIC) {
-        ALOGI("cannot subscribe, property 0x%x is static", property);
-        return false;
-    }
-    if (config->change_mode == VEHICLE_PROP_CHANGE_MODE_POLL) {
-            ALOGI("cannot subscribe, property 0x%x is poll only", property);
-            return false;
-    }
-    return true;
-}
-
-bool VehicleNetworkService::isZonedProperty(vehicle_prop_config_t const * config) {
-    if (config == NULL) {
-        return false;
-    }
-    switch (config->value_type) {
-    case VEHICLE_VALUE_TYPE_ZONED_INT32:
-    case VEHICLE_VALUE_TYPE_ZONED_FLOAT:
-    case VEHICLE_VALUE_TYPE_ZONED_BOOLEAN:
-    case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2:
-    case VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3:
-    case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2:
-    case VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3:
-        return true;
-    }
-    return false;
-}
-
-sp<VehiclePropertiesHolder> VehicleNetworkService::listProperties(int32_t property) {
-    Mutex::Autolock autoLock(mLock);
-    if (property == 0) {
-        if (!mMockingEnabled) {
-            return mProperties;
-        } else {
-            return mPropertiesForMocking;
-        }
-    } else {
-        sp<VehiclePropertiesHolder> p;
-        const vehicle_prop_config_t* config = findConfigLocked(property);
-        if (config != NULL) {
-            p = new VehiclePropertiesHolder(false /* deleteConfigsInDestructor */);
-            p->getList().push_back(config);
-            ASSERT_OR_HANDLE_NO_MEMORY(p.get(), return p);
-        }
-        return p;
-    }
-}
-
-status_t VehicleNetworkService::getProperty(vehicle_prop_value_t *data) {
-    bool inMocking = false;
-    do { // for lock scoping
-        Mutex::Autolock autoLock(mLock);
-        if (!isGettableLocked(data->prop)) {
-            ALOGW("getProperty, cannot get 0x%x", data->prop);
-            return BAD_VALUE;
-        }
-        if ((data->prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                (data->prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-            if (!mCache.readFromCache(data)) {
-                return BAD_VALUE;
-            }
-            return NO_ERROR;
-        }
-        //TODO caching for static, on-change type?
-        if (mMockingEnabled) {
-            inMocking = true;
-        }
-    } while (false);
-    // set done outside lock to allow concurrent access
-    if (inMocking) {
-        status_t r = mHalMock->onPropertyGet(data);
-        if (r != NO_ERROR) {
-            ALOGW("getProperty 0x%x failed, mock returned %d", data->prop, r);
-        }
-        return r;
-    }
-    /*
-     * get call can return -EAGAIN error when hal has not fetched all data. In that case,
-     * keep retrying for certain time with some sleep. This will happen only at initial stage.
-     */
-    status_t r = -EAGAIN;
-    int retryCount = 0;
-    while (true) {
-        r = mDevice->get(mDevice, data);
-        if (r == NO_ERROR) {
-            break;
-        }
-        if (r != -EAGAIN) {
-            break;
-        }
-        retryCount++;
-        if (retryCount > MAX_GET_SET_RETRY_NUMBER_FOR_NOT_READY) {
-            ALOGE("Vehicle hal get, not ready after multiple retries");
-            break;
-        }
-        usleep(GET_SET_WAIT_TIME_US);
-    }
-    if (r != NO_ERROR) {
-        ALOGW("getProperty 0x%x failed, HAL returned %d", data->prop, r);
-    }
-    return r;
-}
-
-void VehicleNetworkService::releaseMemoryFromGet(vehicle_prop_value_t* value) {
-    switch (value->value_type) {
-    case VEHICLE_VALUE_TYPE_STRING:
-    case VEHICLE_VALUE_TYPE_BYTES: {
-        Mutex::Autolock autoLock(mLock);
-        if (mMockingEnabled) {
-            VehiclePropValueUtil::deleteMembers(value);
-        } else {
-            mDevice->release_memory_from_get(mDevice, value);
-        }
-    } break;
-    }
-}
-
-status_t VehicleNetworkService::setProperty(const vehicle_prop_value_t& data) {
-    bool inMocking = false;
-    bool isInternalProperty = data.prop >= VEHICLE_PROPERTY_INTERNAL_START
-                              && data.prop <= VEHICLE_PROPERTY_INTERNAL_END;
-    sp<HalClientSpVector> propertyClientsForSetEvent;
-    do { // for lock scoping
-        Mutex::Autolock autoLock(mLock);
-        if (!isSettableLocked(data.prop, data.value_type)) {
-            ALOGW("setProperty, cannot set 0x%x", data.prop);
-            return BAD_VALUE;
-        }
-        if (isInternalProperty) {
-            mCache.writeToCache(data);
-        }
-        if (mMockingEnabled) {
-            inMocking = true;
-        }
-        if (mPropertiesSubscribedToSetCall.count(data.prop) == 1) {
-            propertyClientsForSetEvent = findClientsVectorForPropertyLocked(data.prop);
-        }
-    } while (false);
-    if (inMocking) {
-        status_t r = mHalMock->onPropertySet(data);
-        if (r != NO_ERROR) {
-            ALOGW("setProperty 0x%x failed, mock returned %d", data.prop, r);
-            return r;
-        }
-    }
-
-    if (propertyClientsForSetEvent.get() != NULL && propertyClientsForSetEvent->size() > 0) {
-        dispatchPropertySetEvent(data, propertyClientsForSetEvent);
-    }
-
-    if (isInternalProperty) {
-        // for internal property, just publish it.
-        onHalEvent(&data, inMocking);
-        return NO_ERROR;
-    }
-    if (inMocking) {
-        return NO_ERROR;
-    }
-    // set done outside lock to allow concurrent access
-    /*
-     * set call can return -EAGAIN error when hal has not fetched all data. In that case,
-     * keep retrying for certain time with some sleep. This will happen only at initial stage.
-     */
-    status_t r = -EAGAIN;
-    int retryCount = 0;
-    while (true) {
-        r = mDevice->set(mDevice, &data);
-        if (r == NO_ERROR) {
-            break;
-        }
-        if (r != -EAGAIN) {
-            break;
-        }
-        retryCount++;
-        if (retryCount > MAX_GET_SET_RETRY_NUMBER_FOR_NOT_READY) {
-            ALOGE("Vehicle hal set, not ready after multiple retries");
-            break;
-        }
-        usleep(GET_SET_WAIT_TIME_US);
-    }
-    if (r != NO_ERROR) {
-        ALOGW("setProperty 0x%x failed, HAL returned %d", data.prop, r);
-    }
-    return r;
-}
-
-void VehicleNetworkService::dispatchPropertySetEvent(
-        const vehicle_prop_value_t& data, const sp<HalClientSpVector>& clientsForProperty) {
-    for (size_t i = 0; i < clientsForProperty->size(); i++) {
-        sp<HalClient> client = clientsForProperty->itemAt(i);
-        SubscriptionInfo* subscription = client->getSubscriptionInfo(data.prop);
-
-        bool shouldDispatch =
-                subscription != NULL
-                && (SubscribeFlags::SET_CALL & subscription->flags)
-                && (data.zone == subscription->zones || (data.zone & subscription->zones));
-
-        if (shouldDispatch) {
-            client->dispatchPropertySetEvent(data);
-        }
-    }
-}
-
-bool isSampleRateFixed(int32_t changeMode) {
-    switch (changeMode) {
-    case VEHICLE_PROP_CHANGE_MODE_ON_CHANGE:
-    case VEHICLE_PROP_CHANGE_MODE_ON_SET:
-        return true;
-    }
-    return false;
-}
-
-status_t VehicleNetworkService::subscribe(const sp<IVehicleNetworkListener> &listener, int32_t prop,
-        float sampleRate, int32_t zones, int32_t flags) {
-    bool shouldSubscribe = false;
-    bool inMock = false;
-    int32_t newZones = zones;
-    vehicle_prop_config_t const * config = NULL;
-    sp<HalClient> client;
-    bool autoGetEnabled = false;
-
-    if (flags == SubscribeFlags::UNDEFINED) {
-        flags = SubscribeFlags::DEFAULT;
-    }
-
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (!isSubscribableLocked(prop)) {
-            return BAD_VALUE;
-        }
-        config = findConfigLocked(prop);
-        if ((flags & SubscribeFlags::SET_CALL)
-            && !(config->access & VEHICLE_PROP_ACCESS_WRITE)) {
-            ALOGE("Attempt to subscribe with SUBSCRIBE_TO_SET flag to prop: 0x%x that doesn't have"
-                          " write access", prop);
-            return BAD_VALUE;
-        }
-
-        if (isSampleRateFixed(config->change_mode)) {
-            if (sampleRate != 0) {
-                ALOGW("Sample rate set to non-zeo for on change type. Ignore it");
-                sampleRate = 0;
-            }
-        } else {
-            if (sampleRate > config->max_sample_rate) {
-                ALOGW("sample rate %f higher than max %f. limit to max", sampleRate,
-                        config->max_sample_rate);
-                sampleRate = config->max_sample_rate;
-            }
-            if (sampleRate < config->min_sample_rate) {
-                ALOGW("sample rate %f lower than min %f. limit to min", sampleRate,
-                                    config->min_sample_rate);
-                sampleRate = config->min_sample_rate;
-            }
-        }
-        if (isZonedProperty(config)) {
-            if ((zones != 0) && ((zones & config->vehicle_zone_flags) != zones)) {
-                ALOGE("subscribe requested zones 0x%x out of range, supported:0x%x", zones,
-                        config->vehicle_zone_flags);
-                return BAD_VALUE;
-            }
-        } else { // ignore zone
-            zones = 0;
-        }
-        sp<IBinder> ibinder = IInterface::asBinder(listener);
-        LOG_VERBOSE("subscribe, binder 0x%x prop 0x%x", ibinder.get(), prop);
-        client = findOrCreateClientLocked(ibinder, listener);
-        if (client.get() == NULL) {
-            ALOGE("subscribe, no memory, cannot create HalClient");
-            return NO_MEMORY;
-        }
-        sp<HalClientSpVector> clientsForProperty = findOrCreateClientsVectorForPropertyLocked(prop);
-        if (clientsForProperty.get() == NULL) {
-            ALOGE("subscribe, no memory, cannot create HalClientSpVector");
-            return NO_MEMORY;
-        }
-        clientsForProperty->add(client);
-        ssize_t index = mSubscriptionInfos.indexOfKey(prop);
-        if (index < 0) {
-            // first time subscription for this property
-            shouldSubscribe = true;
-        } else {
-            const SubscriptionInfo& info = mSubscriptionInfos.valueAt(index);
-            if (info.sampleRate < sampleRate) {
-                shouldSubscribe = true;
-            }
-            newZones = (info.zones == 0) ? 0 : ((zones == 0) ? 0 : (info.zones | zones));
-            if (info.zones != newZones) {
-                shouldSubscribe = true;
-            }
-            if (info.flags != flags) {  // Flags has been changed, need to update subscription.
-                shouldSubscribe = true;
-            }
-        }
-        if (SubscribeFlags::SET_CALL & flags) {
-            mPropertiesSubscribedToSetCall.insert(prop);
-        }
-        client->setSubscriptionInfo(prop, sampleRate, zones, flags);
-        if (shouldSubscribe) {
-            autoGetEnabled = mVehiclePropertyAccessControl.isAutoGetEnabled(prop);
-            inMock = mMockingEnabled;
-            SubscriptionInfo info(sampleRate, newZones, flags);
-            mSubscriptionInfos.add(prop, info);
-            if ((prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                                (prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-                LOG_VERBOSE("subscribe to internal property, prop 0x%x", prop);
-                return NO_ERROR;
-            }
-        }
-    } while (false);
-    if (shouldSubscribe && (SubscribeFlags::HAL_EVENT & flags)) {
-        if (inMock) {
-            status_t r = mHalMock->onPropertySubscribe(prop, sampleRate, newZones);
-            if (r != NO_ERROR) {
-                ALOGW("subscribe 0x%x failed, mock returned %d", prop, r);
-                return r;
-            }
-        } else {
-            LOG_VERBOSE("subscribe to HAL, prop 0x%x sample rate:%f zones:0x%x", prop, sampleRate,
-                    newZones);
-            status_t r = mDevice->subscribe(mDevice, prop, sampleRate, newZones);
-            if (r != NO_ERROR) {
-                ALOGW("subscribe 0x%x failed, HAL returned %d", prop, r);
-                return r;
-            }
-        }
-    }
-    if (autoGetEnabled && isSampleRateFixed(config->change_mode)) {
-        status_t r = notifyClientWithCurrentValue(inMock, config, zones);
-        if (r != NO_ERROR) {
-            return r;
-        }
-    }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkService::notifyClientWithCurrentValue(bool isMocking,
-        const vehicle_prop_config_t *config, int32_t zones) {
-    status_t r;
-    int32_t prop = config->prop;
-    int32_t valueType = config->value_type;
-    if (isZonedProperty(config)) {
-        int32_t requestedZones = (zones == 0) ? config->vehicle_zone_flags : zones;
-        for (int i = 0, zone = 1; i < 32; i++, zone <<= 1) {
-            if ((zone & requestedZones) == zone) {
-                    r = notifyClientWithCurrentValue(isMocking, prop, valueType, zone);
-                    if (r != NO_ERROR) {
-                        return r;
-                    }
-                }
-            }
-        } else {
-            r = notifyClientWithCurrentValue(isMocking, prop, valueType, 0 /*no zones*/);
-            if (r != NO_ERROR) {
-                return r;
-            }
-        }
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkService::notifyClientWithCurrentValue(bool isMocking,
-    int32_t prop, int32_t valueType, int32_t zone) {
-    std::unique_ptr<vehicle_prop_value_t> v(new vehicle_prop_value_t());
-    ASSERT_OR_HANDLE_NO_MEMORY(v.get(), return NO_MEMORY);
-    memset(v.get(), 0, sizeof(vehicle_prop_value_t));
-    v->prop = prop;
-    v->value_type = valueType;
-    v->zone = zone;
-    status_t r = isMocking ? mHalMock->onPropertyGet(v.get()) : mDevice->get(mDevice, v.get());
-    if (r != NO_ERROR) {
-        if (r == -EAGAIN) {
-            LOG_VERBOSE("value is not ready:0x%x, mock:%d", prop, isMocking);
-            return NO_ERROR;
-        } else {
-            ALOGW("failed to get current value prop:0x%x, mock:%d, error:%d", prop, isMocking, r);
-            return r;
-        }
-    }
-    if (isMocking) {
-        // no copy and vehicle_prop_value_t is passed to event handler
-        onHalEvent(v.release(), false, false /*do not copy */);
-    } else {
-        // copy is made, and vehicle_prop_value_t deleted in this function
-        onHalEvent(v.get(), false, true /*do copy */);
-        releaseMemoryFromGet(v.get());
-    }
-
-    return NO_ERROR;
-}
-
-void VehicleNetworkService::unsubscribe(const sp<IVehicleNetworkListener> &listener, int32_t prop) {
-    bool shouldUnsubscribe = false;
-    bool inMocking = false;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (!isSubscribableLocked(prop)) {
-            return;
-        }
-        sp<IBinder> ibinder = IInterface::asBinder(listener);
-        LOG_VERBOSE("unsubscribe, binder 0x%x, prop 0x%x", ibinder.get(), prop);
-        sp<HalClient> client = findClientLocked(ibinder);
-        if (client.get() == NULL) {
-            ALOGD("unsubscribe client not found in binder map");
-            return;
-        }
-        shouldUnsubscribe = removePropertyFromClientLocked(ibinder, client, prop);
-        if ((prop >= (int32_t)VEHICLE_PROPERTY_INTERNAL_START) &&
-                (prop <= (int32_t)VEHICLE_PROPERTY_INTERNAL_END)) {
-            LOG_VERBOSE("unsubscribe to internal property, prop 0x%x", prop);
-            return;
-        }
-        if (mMockingEnabled) {
-            inMocking = true;
-        }
-    } while (false);
-    if (shouldUnsubscribe) {
-        if (inMocking) {
-            mHalMock->onPropertyUnsubscribe(prop);
-        } else {
-            mDevice->unsubscribe(mDevice, prop);
-        }
-    }
-}
-
-sp<HalClient> VehicleNetworkService::findClientLocked(sp<IBinder>& ibinder) {
-    sp<HalClient> client;
-    ssize_t index = mBinderToClientMap.indexOfKey(ibinder);
-    if (index < 0) {
-        return client;
-    }
-    return mBinderToClientMap.editValueAt(index);
-}
-
-sp<HalClient> VehicleNetworkService::findOrCreateClientLocked(sp<IBinder>& ibinder,
-        const sp<IVehicleNetworkListener> &listener) {
-    sp<HalClient> client;
-    ssize_t index = mBinderToClientMap.indexOfKey(ibinder);
-    if (index < 0) {
-        IPCThreadState* self = IPCThreadState::self();
-        pid_t pid = self->getCallingPid();
-        uid_t uid = self->getCallingUid();
-        client = new HalClient(listener, pid, uid);
-        ASSERT_OR_HANDLE_NO_MEMORY(client.get(), return client);
-        ibinder->linkToDeath(this);
-        LOG_VERBOSE("add binder 0x%x to map", ibinder.get());
-        mBinderToClientMap.add(ibinder, client);
-    } else {
-        client = mBinderToClientMap.editValueAt(index);
-    }
-    return client;
-}
-
-sp<HalClientSpVector> VehicleNetworkService::findClientsVectorForPropertyLocked(int32_t property) {
-    sp<HalClientSpVector> clientsForProperty;
-    ssize_t index = mPropertyToClientsMap.indexOfKey(property);
-    if (index >= 0) {
-        clientsForProperty = mPropertyToClientsMap.editValueAt(index);
-    }
-    return clientsForProperty;
-}
-
-sp<HalClientSpVector> VehicleNetworkService::findOrCreateClientsVectorForPropertyLocked(
-        int32_t property) {
-    sp<HalClientSpVector> clientsForProperty;
-    ssize_t index = mPropertyToClientsMap.indexOfKey(property);
-    if (index >= 0) {
-        clientsForProperty = mPropertyToClientsMap.editValueAt(index);
-    } else {
-        clientsForProperty = new HalClientSpVector();
-        ASSERT_OR_HANDLE_NO_MEMORY(clientsForProperty.get(), return clientsForProperty);
-        mPropertyToClientsMap.add(property, clientsForProperty);
-    }
-    return clientsForProperty;
-}
-
-bool VehicleNetworkService::hasClientsSubscribedToSetCallLocked(
-        int32_t property, const sp<HalClientSpVector> &clientsForProperty) const {
-    for (size_t i = 0; i < clientsForProperty->size(); i++) {
-        sp<HalClient> c = clientsForProperty->itemAt(i);
-        SubscriptionInfo* subscription = c->getSubscriptionInfo(property);
-        if (subscription != NULL && (SubscribeFlags::SET_CALL & subscription->flags)) {
-            return true;
-        }
-    }
-    return false;
-}
-
-/**
- * remove given property from client and remove HalClient if necessary.
- * @return true if the property should be unsubscribed from HAL (=no more clients).
- */
-bool VehicleNetworkService::removePropertyFromClientLocked(sp<IBinder>& ibinder,
-        sp<HalClient>& client, int32_t property) {
-    if(!client->removePropertyAndCheckIfActive(property)) {
-        // client is no longer necessary
-        mBinderToClientMap.removeItem(ibinder);
-        ibinder->unlinkToDeath(this);
-    }
-    sp<HalClientSpVector> clientsForProperty = findClientsVectorForPropertyLocked(property);
-    if (clientsForProperty.get() == NULL) {
-        // no subscription
-        return false;
-    }
-    clientsForProperty->remove(client);
-
-    if (!hasClientsSubscribedToSetCallLocked(property, clientsForProperty)) {
-        mPropertiesSubscribedToSetCall.erase(property);
-    }
-
-    //TODO reset sample rate. do not care for now.
-    if (clientsForProperty->size() == 0) {
-        mPropertyToClientsMap.removeItem(property);
-        mSubscriptionInfos.removeItem(property);
-        return true;
-    }
-    return false;
-}
-
-status_t VehicleNetworkService::injectEvent(const vehicle_prop_value_t& value) {
-    ALOGI("injectEvent property:0x%x", value.prop);
-    return onHalEvent(&value, true);
-}
-
-status_t VehicleNetworkService::startMocking(const sp<IVehicleNetworkHalMock>& mock) {
-    sp<VehicleHalMessageHandler> handler;
-    List<sp<HalClient> > clientsToDispatch;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mMockingEnabled) {
-            ALOGW("startMocking while already enabled");
-            // allow it as test can fail without clearing
-            if (mHalMock != NULL) {
-                IInterface::asBinder(mHalMock)->unlinkToDeath(mHalMockDeathHandler.get());
-            }
-        }
-        ALOGW("starting vehicle HAL mocking");
-        sp<IBinder> ibinder = IInterface::asBinder(mock);
-        mHalMockDeathHandler = new MockDeathHandler(*this);
-        ibinder->linkToDeath(mHalMockDeathHandler);
-        mHalMock = mock;
-        mMockingEnabled = true;
-        // Mock implementation should make sure that its startMocking call is not blocking its
-        // onlistProperties call. Otherwise, this will lead into dead-lock.
-        mPropertiesForMocking = mock->onListProperties();
-        handleHalRestartAndGetClientsToDispatchLocked(clientsToDispatch);
-        handler = mHandler;
-    } while (false);
-    handler->handleMockStateChange();
-    for (auto& client : clientsToDispatch) {
-        client->dispatchHalRestart(true);
-    }
-    clientsToDispatch.clear();
-    return NO_ERROR;
-}
-
-void VehicleNetworkService::stopMocking(const sp<IVehicleNetworkHalMock>& mock) {
-    List<sp<HalClient> > clientsToDispatch;
-    sp<VehicleHalMessageHandler> handler;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (mHalMock.get() == NULL) {
-            return;
-        }
-        sp<IBinder> ibinder = IInterface::asBinder(mock);
-        if (ibinder != IInterface::asBinder(mHalMock)) {
-            ALOGE("stopMocking, not the one started");
-            return;
-        }
-        ALOGW("stopping vehicle HAL mocking");
-        ibinder->unlinkToDeath(mHalMockDeathHandler.get());
-        mHalMockDeathHandler.clear();
-        mHalMock.clear();
-        mMockingEnabled = false;
-        mPropertiesForMocking.clear();
-        handleHalRestartAndGetClientsToDispatchLocked(clientsToDispatch);
-        handler = mHandler;
-    } while (false);
-    handler->handleMockStateChange();
-    for (auto& client : clientsToDispatch) {
-        client->dispatchHalRestart(false);
-    }
-    clientsToDispatch.clear();
-}
-
-void VehicleNetworkService::handleHalRestartAndGetClientsToDispatchLocked(
-        List<sp<HalClient> >& clientsToDispatch) {
-    // all subscriptions are invalid
-    mPropertyToClientsMap.clear();
-    mSubscriptionInfos.clear();
-    mEventInfos.clear();
-    List<sp<HalClient> > clientsToRemove;
-    for (size_t i = 0; i < mBinderToClientMap.size(); i++) {
-        sp<HalClient> client = mBinderToClientMap.valueAt(i);
-        client->removeAllProperties();
-        if (client->isMonitoringHalRestart()) {
-            clientsToDispatch.push_back(client);
-        }
-        if (!client->isActive()) {
-            clientsToRemove.push_back(client);
-        }
-    }
-    for (auto& client : clientsToRemove) {
-        // client is no longer necessary
-        sp<IBinder> ibinder = IInterface::asBinder(client->getListener());
-        mBinderToClientMap.removeItem(ibinder);
-        ibinder->unlinkToDeath(this);
-    }
-    clientsToRemove.clear();
-}
-
-status_t VehicleNetworkService::injectHalError(int32_t errorCode, int32_t property,
-        int32_t operation) {
-    return onHalError(errorCode, property, operation, true /*isInjection*/);
-}
-
-status_t VehicleNetworkService::startErrorListening(const sp<IVehicleNetworkListener> &listener) {
-    sp<IBinder> ibinder = IInterface::asBinder(listener);
-    sp<HalClient> client;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        client = findOrCreateClientLocked(ibinder, listener);
-    } while (false);
-    if (client.get() == NULL) {
-        ALOGW("startErrorListening failed, no memory");
-        return NO_MEMORY;
-    }
-    client->setHalErrorMonitoringState(true);
-    return NO_ERROR;
-}
-
-void VehicleNetworkService::stopErrorListening(const sp<IVehicleNetworkListener> &listener) {
-    sp<IBinder> ibinder = IInterface::asBinder(listener);
-    sp<HalClient> client;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        client = findClientLocked(ibinder);
-    } while (false);
-    if (client.get() != NULL) {
-        client->setHalErrorMonitoringState(false);
-    }
-}
-
-status_t VehicleNetworkService::startHalRestartMonitoring(
-        const sp<IVehicleNetworkListener> &listener) {
-    sp<IBinder> ibinder = IInterface::asBinder(listener);
-    sp<HalClient> client;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        client = findOrCreateClientLocked(ibinder, listener);
-    } while (false);
-    if (client.get() == NULL) {
-        ALOGW("startHalRestartMonitoring failed, no memory");
-        return NO_MEMORY;
-    }
-    client->setHalRestartMonitoringState(true);
-    return NO_ERROR;
-}
-
-void VehicleNetworkService::stopHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener) {
-    sp<IBinder> ibinder = IInterface::asBinder(listener);
-    sp<HalClient> client;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        client = findClientLocked(ibinder);
-    } while (false);
-    if (client.get() != NULL) {
-        client->setHalRestartMonitoringState(false);
-    }
-}
-
-status_t VehicleNetworkService::onHalEvent(const vehicle_prop_value_t* eventData, bool isInjection,
-        bool doCopy)
-{
-    sp<VehicleHalMessageHandler> handler;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (!isInjection && mMockingEnabled) {
-            // drop real HAL event if mocking is enabled
-            mDroppedEventsWhileInMocking++;
-            mLastEventDropTimeWhileInMocking = elapsedRealtimeNano();
-            if (!doCopy) { // ownership passed here. so should delete here.
-                VehiclePropValueUtil::deleteVehiclePropValue(
-                        const_cast<vehicle_prop_value_t*>(eventData));
-            }
-            return NO_ERROR;
-        }
-        ssize_t index = mEventInfos.indexOfKey(eventData->prop);
-        if (index < 0) {
-            EventInfo info(eventData->timestamp, 1);
-            mEventInfos.add(eventData->prop, info);
-        } else {
-            EventInfo& info = mEventInfos.editValueAt(index);
-            info.eventCount++;
-            info.lastTimestamp = eventData->timestamp;
-        }
-        handler = mHandler;
-    } while (false);
-    //TODO add memory pool
-    vehicle_prop_value_t* copy;
-    if (doCopy) {
-        copy = VehiclePropValueUtil::allocVehiclePropValue(*eventData);
-        ASSERT_OR_HANDLE_NO_MEMORY(copy, return NO_MEMORY);
-    } else {
-        copy = const_cast<vehicle_prop_value_t*>(eventData);
-    }
-    handler->handleHalEvent(copy);
-    return NO_ERROR;
-}
-
-status_t VehicleNetworkService::onHalError(int32_t errorCode, int32_t property, int32_t operation,
-        bool isInjection) {
-    sp<VehicleHalMessageHandler> handler;
-    VehicleHalError* error = NULL;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (!isInjection) {
-            if (mMockingEnabled) {
-                // drop real HAL error if mocking is enabled
-                return NO_ERROR;
-            }
-        }
-
-        error = new VehicleHalError(errorCode, property, operation);
-        if (error == NULL) {
-            return NO_MEMORY;
-        }
-        handler = mHandler;
-    } while (false);
-    ALOGI("HAL error, error code:%d, property:0x%x, operation:%d, isInjection:%d",
-            errorCode, property, operation, isInjection? 1 : 0);
-    handler->handleHalError(error);
-    return NO_ERROR;
-}
-
-void VehicleNetworkService::dispatchHalEvents(List<vehicle_prop_value_t*>& events) {
-    HalClientSpVector activeClients;
-    do { // for lock scoping
-        Mutex::Autolock autoLock(mLock);
-        for (vehicle_prop_value_t* e : events) {
-            ssize_t index = mPropertyToClientsMap.indexOfKey(e->prop);
-            if (index < 0) {
-                EVENT_LOG("HAL event for not subscribed property 0x%x", e->prop);
-                continue;
-            }
-            sp<HalClientSpVector>& clients = mPropertyToClientsMap.editValueAt(index);
-            EVENT_LOG("dispatchHalEvents, prop 0x%x, active clients %d", e->prop, clients->size());
-            for (size_t i = 0; i < clients->size(); i++) {
-                sp<HalClient>& client = clients->editItemAt(i);
-                const SubscriptionInfo* info = client->getSubscriptionInfo(e->prop);
-                if (SubscribeFlags::HAL_EVENT & info->flags) {
-                    activeClients.add(client);
-                    client->addEvent(e);
-                } else {
-                    EVENT_LOG("Client is not subsribed to HAL events, prop: 0x%x", e->prop);
-                }
-            }
-        }
-    } while (false);
-    EVENT_LOG("dispatchHalEvents num events %d, active clients:%d", events.size(),
-            activeClients.size());
-    int64_t now = elapsedRealtimeNano();
-    for (size_t i = 0; i < activeClients.size(); i++) {
-        sp<HalClient> client = activeClients.editItemAt(i);
-        client->dispatchEvents(now);
-    }
-    activeClients.clear();
-}
-
-void VehicleNetworkService::dispatchHalError(VehicleHalError* error) {
-    List<sp<HalClient> > clientsToDispatch;
-    do {
-        Mutex::Autolock autoLock(mLock);
-        if (error->property != 0) {
-            sp<HalClientSpVector> clientsForProperty = findClientsVectorForPropertyLocked(
-                    error->property);
-            if (clientsForProperty.get() != NULL) {
-                for (size_t i = 0; i < clientsForProperty->size(); i++) {
-                    sp<HalClient> client = clientsForProperty->itemAt(i);
-                    clientsToDispatch.push_back(client);
-                }
-            }
-        }
-        // Send to global error handler if property is 0 or if no client subscribing.
-        if (error->property == 0 || clientsToDispatch.size() == 0) {
-            for (size_t i = 0; i < mBinderToClientMap.size(); i++) {
-                sp<HalClient> client = mBinderToClientMap.valueAt(i);
-                if (client->isMonitoringHalError()) {
-                    clientsToDispatch.push_back(client);
-                }
-            }
-        }
-    } while (false);
-    ALOGI("dispatchHalError error:%d, property:0x%x, operation:%d, num clients to dispatch:%zu",
-            error->errorCode, error->property, error->operation, clientsToDispatch.size());
-    for (auto& client : clientsToDispatch) {
-        client->dispatchHalError(error->errorCode, error->property, error->operation);
-    }
-    clientsToDispatch.clear();
-}
-
-status_t VehicleNetworkService::loadHal() {
-    int r = hw_get_module(VEHICLE_HARDWARE_MODULE_ID, (hw_module_t const**)&mModule);
-    if (r != NO_ERROR) {
-        ALOGE("cannot load HAL module, error:%d", r);
-        return r;
-    }
-    r = mModule->common.methods->open(&mModule->common, VEHICLE_HARDWARE_DEVICE,
-            (hw_device_t**)&mDevice);
-    return r;
-}
-
-void VehicleNetworkService::closeHal() {
-    mDevice->common.close(&mDevice->common);
-}
-};
diff --git a/vehicle_network_service/VehicleNetworkService.h b/vehicle_network_service/VehicleNetworkService.h
deleted file mode 100644
index a0fd296..0000000
--- a/vehicle_network_service/VehicleNetworkService.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (C) 2015 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 CAR_VEHICLE_NETWORK_SERVICE_H_
-#define CAR_VEHICLE_NETWORK_SERVICE_H_
-
-#include <inttypes.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <unordered_set>
-
-#include <memory>
-
-#include <hardware/hardware.h>
-#include <hardware/vehicle.h>
-
-#include <binder/BinderService.h>
-#include <binder/IBinder.h>
-#include <binder/IPCThreadState.h>
-#include <cutils/compiler.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <utils/List.h>
-#include <utils/RefBase.h>
-#include <utils/SortedVector.h>
-#include <utils/StrongPointer.h>
-#include <utils/TypeHelpers.h>
-
-#include <IVehicleNetwork.h>
-#include <IVehicleNetworkListener.h>
-#include <HandlerThread.h>
-
-#include "VehiclePropertyAccessControl.h"
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-class VehicleNetworkService;
-
-/**
- * MessageHandler to dispatch HAL callbacks to pre-defined handler thread context.
- * Init / release is handled in the handler thread to allow upper layer to allocate resource
- * for the thread.
- */
-class VehicleHalMessageHandler : public MessageHandler {
-    enum {
-        HAL_EVENT = 0,
-        HAL_ERROR = 1,
-    };
-
-    /**
-     * For dispatching HAL event in batch. Hal events coming in this time frame will be batched
-     * together.
-     */
-    static const int DISPATCH_INTERVAL_MS = 16;
-    static const int NUM_PROPERTY_EVENT_LISTS = 2;
-public:
-    // not passing VNS as sp as this is held by VNS always.
-    VehicleHalMessageHandler(const sp<Looper>& mLooper, VehicleNetworkService& service);
-    virtual ~VehicleHalMessageHandler();
-
-    void handleHalEvent(vehicle_prop_value_t *eventData);
-    void handleHalError(VehicleHalError* error);
-    void handleMockStateChange();
-    void dump(String8& msg);
-
-private:
-    void handleMessage(const Message& message);
-    void doHandleHalEvent();
-    void doHandleHalError();
-
-private:
-    mutable Mutex mLock;
-    const sp<Looper> mLooper;
-    VehicleNetworkService& mService;
-    int mFreeListIndex;
-    List<vehicle_prop_value_t*> mHalPropertyList[NUM_PROPERTY_EVENT_LISTS];
-    int64_t mLastDispatchTime;
-    List<VehicleHalError*> mHalErrors;
-};
-// ----------------------------------------------------------------------------
-class SubscriptionInfo {
-public:
-    float sampleRate;
-    int32_t zones;
-    int32_t flags;
-    SubscriptionInfo()
-        : sampleRate(0),
-          zones(0),
-          flags(SubscribeFlags::DEFAULT) {};
-    SubscriptionInfo(float aSampleRate, int32_t aZones, int32_t aFlags)
-        : sampleRate(aSampleRate),
-          zones(aZones),
-          flags(aFlags) {};
-    SubscriptionInfo(const SubscriptionInfo& info)
-        : sampleRate(info.sampleRate),
-          zones(info.zones),
-          flags(info.flags) {};
-};
-
-// ----------------------------------------------------------------------------
-class EventInfo {
-public:
-    int64_t lastTimestamp;
-    int eventCount;
-    EventInfo()
-        : lastTimestamp(0),
-          eventCount(0) {};
-    EventInfo(int64_t aLastTimestamp, int aEventCount)
-        : lastTimestamp(aLastTimestamp),
-          eventCount(aEventCount) {};
-    EventInfo(const EventInfo& info)
-        : lastTimestamp(info.lastTimestamp),
-          eventCount(info.eventCount) {};
-};
-// ----------------------------------------------------------------------------
-
-class HalClient : public virtual RefBase {
-public:
-    HalClient(const sp<IVehicleNetworkListener> &listener, pid_t pid, uid_t uid) :
-        mListener(listener),
-        mPid(pid),
-        mUid(uid),
-        mMonitoringHalRestart(false),
-        mMonitoringHalError(false),
-        mLastDispatchedEventCounts(0),
-        mTotalDispatchedEvents(0),
-        mLastDispatchTime(0) {
-    }
-
-    virtual ~HalClient() {
-        mSubscriptionInfos.clear();
-    }
-
-    pid_t getPid() {
-        return mPid;
-    }
-
-    uid_t getUid() {
-        return mUid;
-    }
-
-    SubscriptionInfo* getSubscriptionInfo(int32_t property) {
-        Mutex::Autolock autoLock(mLock);
-        ssize_t index = mSubscriptionInfos.indexOfKey(property);
-        if (index < 0) {
-            return NULL;
-        }
-        return &mSubscriptionInfos.editValueAt(index);
-    }
-
-    void setSubscriptionInfo(int32_t property, float sampleRate, int32_t zones, int32_t flags) {
-        Mutex::Autolock autoLock(mLock);
-        SubscriptionInfo info(sampleRate, zones, flags);
-        mSubscriptionInfos.add(property, info);
-    }
-
-    bool removePropertyAndCheckIfActive(int32_t property) {
-        Mutex::Autolock autoLock(mLock);
-        mSubscriptionInfos.removeItem(property);
-        return mSubscriptionInfos.size() > 0 || mMonitoringHalRestart || mMonitoringHalError;
-    }
-
-    void removeAllProperties() {
-        Mutex::Autolock autoLock(mLock);
-        mSubscriptionInfos.clear();
-    }
-
-    bool isActive() {
-        Mutex::Autolock autoLock(mLock);
-        return mSubscriptionInfos.size() > 0 || mMonitoringHalRestart || mMonitoringHalError;
-    }
-
-    void setHalRestartMonitoringState(bool state) {
-        Mutex::Autolock autoLock(mLock);
-        mMonitoringHalRestart = state;
-    }
-
-    bool isMonitoringHalRestart() {
-        Mutex::Autolock autoLock(mLock);
-        return mMonitoringHalRestart;
-    }
-
-    void setHalErrorMonitoringState(bool state) {
-        Mutex::Autolock autoLock(mLock);
-        mMonitoringHalError = state;
-    }
-
-    bool isMonitoringHalError() {
-        Mutex::Autolock autoLock(mLock);
-        return mMonitoringHalError;
-    }
-
-    const sp<IVehicleNetworkListener>& getListener() {
-        return mListener;
-    }
-
-    const sp<IBinder> getListenerAsBinder() {
-        return IInterface::asBinder(mListener);
-    }
-
-    // no lock here as this should be called only from single event looper thread
-    void addEvent(vehicle_prop_value_t* event) {
-        mEvents.push_back(event);
-    }
-
-    // no lock here as this should be called only from single event looper thread
-    void clearEvents() {
-        mEvents.clear();
-    }
-
-    // no lock here as this should be called only from single event looper thread
-    List<vehicle_prop_value_t*>& getEventList() {
-        return mEvents;
-    }
-
-    // no lock here as this should be called only from single event looper thread
-    status_t dispatchEvents(const int64_t& timestamp) {
-        ALOGV("dispatchEvents, num Events:%zu", mEvents.size());
-        sp<VehiclePropValueListHolder> events(new VehiclePropValueListHolder(&mEvents,
-                false /*deleteInDestructor */));
-        ASSERT_OR_HANDLE_NO_MEMORY(events.get(), return NO_MEMORY);
-        mLastDispatchTime = timestamp;
-        mLastDispatchedEventCounts = mEvents.size();
-        mTotalDispatchedEvents += mLastDispatchedEventCounts;
-        mListener->onEvents(events);
-        mEvents.clear();
-        return NO_ERROR;
-    }
-
-    void dispatchHalError(int32_t errorCode, int32_t property, int32_t operation) {
-        mListener->onHalError(errorCode, property, operation);
-    }
-
-    void dispatchHalRestart(bool inMocking) {
-        mListener->onHalRestart(inMocking);
-    }
-
-    void dispatchPropertySetEvent(const vehicle_prop_value_t& value) {
-        mListener->onPropertySet(value);
-    }
-
-    void dump(String8& msg) {
-        msg.appendFormat("pid:%d, uid:%d, mLastDispatchedEventCounts:%d, mTotalDispatchedEvents:%d"
-                ", mLastDispatchTime:%" PRId64 "\n",
-                mPid, mUid, mLastDispatchedEventCounts, mTotalDispatchedEvents, mLastDispatchTime);
-    }
-
-private:
-    mutable Mutex mLock;
-    const sp<IVehicleNetworkListener> mListener;
-    const pid_t mPid;
-    const uid_t mUid;
-    KeyedVector<int32_t, SubscriptionInfo> mSubscriptionInfos;
-    List<vehicle_prop_value_t*> mEvents;
-    bool mMonitoringHalRestart;
-    bool mMonitoringHalError;
-    int mLastDispatchedEventCounts;
-    int mTotalDispatchedEvents;
-    int64_t mLastDispatchTime;
-};
-
-class HalClientSpVector : public SortedVector<sp<HalClient> >, public RefBase {
-public:
-    virtual ~HalClientSpVector() {};
-protected:
-    virtual int do_compare(const void* lhs, const void* rhs) const {
-        sp<HalClient>& lh = * (sp<HalClient> * )(lhs);
-        sp<HalClient>& rh = * (sp<HalClient> * )(rhs);
-        return compare_type(lh.get(), rh.get());
-    }
-};
-
-// ----------------------------------------------------------------------------
-
-/**
- * Keeps cached value of property values.
- * For internal property, static property, and on_change property, caching makes sense.
- */
-class PropertyValueCache {
-public:
-    PropertyValueCache();
-    virtual ~PropertyValueCache();
-    void writeToCache(const vehicle_prop_value_t& value);
-    bool readFromCache(vehicle_prop_value_t* value);
-
-private:
-    KeyedVector<int32_t, vehicle_prop_value_t*> mCache;
-};
-
-// ----------------------------------------------------------------------------
-
-class MockDeathHandler: public IBinder::DeathRecipient {
-public:
-    MockDeathHandler(VehicleNetworkService& vns) :
-        mService(vns) {};
-    virtual ~MockDeathHandler() {};
-    virtual void binderDied(const wp<IBinder>& who);
-
-private:
-    VehicleNetworkService& mService;
-};
-
-// ----------------------------------------------------------------------------
-class VehicleNetworkService :
-    public BinderService<VehicleNetworkService>,
-    public BnVehicleNetwork,
-    public IBinder::DeathRecipient {
-public:
-    static const char* getServiceName() ANDROID_API { return IVehicleNetwork::SERVICE_NAME; };
-
-    VehicleNetworkService();
-    virtual ~VehicleNetworkService();
-    virtual status_t dump(int fd, const Vector<String16>& args);
-    void release();
-    status_t onHalEvent(const vehicle_prop_value_t *eventData, bool isInjection = false,
-            bool doCopy = true);
-    status_t onHalError(int32_t errorCode, int32_t property, int32_t operation,
-            bool isInjection = false);
-    status_t onPropertySet(const vehicle_prop_value_t& eventData);
-    /**
-     * Called by VehicleHalMessageHandler for batching events
-     */
-    void dispatchHalEvents(List<vehicle_prop_value_t*>& events);
-    void dispatchHalError(VehicleHalError* error);
-    virtual sp<VehiclePropertiesHolder> listProperties(int32_t property = 0);
-    virtual status_t setProperty(const vehicle_prop_value_t& value);
-    virtual status_t getProperty(vehicle_prop_value_t* value);
-    virtual void releaseMemoryFromGet(vehicle_prop_value_t* value);
-    virtual status_t subscribe(const sp<IVehicleNetworkListener> &listener, int32_t property,
-            float sampleRate, int32_t zones, int32_t flags = SubscribeFlags::DEFAULT);
-    virtual void unsubscribe(const sp<IVehicleNetworkListener> &listener, int32_t property);
-    virtual status_t injectEvent(const vehicle_prop_value_t& value);
-    virtual status_t startMocking(const sp<IVehicleNetworkHalMock>& mock);
-    virtual void stopMocking(const sp<IVehicleNetworkHalMock>& mock);
-    virtual status_t injectHalError(int32_t errorCode, int32_t property, int32_t operation);
-    virtual status_t startErrorListening(const sp<IVehicleNetworkListener> &listener);
-    virtual void stopErrorListening(const sp<IVehicleNetworkListener> &listener);
-    virtual status_t startHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener);
-    virtual void stopHalRestartMonitoring(const sp<IVehicleNetworkListener> &listener);
-    virtual void binderDied(const wp<IBinder>& who);
-    bool isPropertySubsribed(int32_t property);
-
-    void handleHalMockDeath(const wp<IBinder>& who);
-protected:
-    virtual bool isOperationAllowed(int32_t property, bool isWrite);
-private:
-    // RefBase
-    virtual void onFirstRef();
-    status_t loadHal();
-    void closeHal();
-    vehicle_prop_config_t const * findConfigLocked(int32_t property);
-    bool isGettableLocked(int32_t property);
-    bool isSettableLocked(int32_t property, int32_t valueType);
-    bool isSubscribableLocked(int32_t property);
-    status_t getProperty(vehicle_prop_value_t *data, bool retry);
-    static bool isZonedProperty(vehicle_prop_config_t const * config);
-    sp<HalClient> findClientLocked(sp<IBinder>& ibinder);
-    sp<HalClient> findOrCreateClientLocked(sp<IBinder>& ibinder,
-            const sp<IVehicleNetworkListener> &listener);
-    sp<HalClientSpVector> findClientsVectorForPropertyLocked(int32_t property);
-    sp<HalClientSpVector> findOrCreateClientsVectorForPropertyLocked(int32_t property);
-    bool removePropertyFromClientLocked(sp<IBinder>& ibinder, sp<HalClient>& client,
-            int32_t property);
-    bool hasClientsSubscribedToSetCallLocked(int32_t property,
-                                             const sp<HalClientSpVector> &clientsForProperty) const;
-    void handleHalRestartAndGetClientsToDispatchLocked(List<sp<HalClient> >& clientsToDispatch);
-    status_t notifyClientWithCurrentValue(bool isMocking, const vehicle_prop_config_t *config,
-                                          int32_t zones);
-    status_t notifyClientWithCurrentValue(bool isMocking, int32_t prop, int32_t valueType,
-                                          int32_t zone);
-    void dispatchPropertySetEvent(const vehicle_prop_value_t& data,
-                                  const sp<HalClientSpVector>& propertyClients);
-
-    static int eventCallback(const vehicle_prop_value_t *eventData);
-    static int errorCallback(int32_t errorCode, int32_t property, int32_t operation);
-private:
-    static const int GET_SET_WAIT_TIME_US = 100000;
-    static const int MAX_GET_SET_RETRY_NUMBER_FOR_NOT_READY = 20;
-
-    VehiclePropertyAccessControl mVehiclePropertyAccessControl;
-    static VehicleNetworkService* sInstance;
-    sp<HandlerThread> mHandlerThread;
-    sp<VehicleHalMessageHandler> mHandler;
-    mutable Mutex mLock;
-    vehicle_module_t* mModule;
-    vehicle_hw_device_t* mDevice;
-    sp<VehiclePropertiesHolder> mProperties;
-    KeyedVector<sp<IBinder>, sp<HalClient> > mBinderToClientMap;
-    // client subscribing properties
-    KeyedVector<int32_t, sp<HalClientSpVector> > mPropertyToClientsMap;
-    KeyedVector<int32_t, SubscriptionInfo> mSubscriptionInfos;
-    KeyedVector<int32_t, EventInfo> mEventInfos;
-    std::unordered_set<int32_t> mPropertiesSubscribedToSetCall;
-    PropertyValueCache mCache;
-    bool mMockingEnabled;
-    int mDroppedEventsWhileInMocking;
-    int64_t mLastEventDropTimeWhileInMocking;
-    sp<IVehicleNetworkHalMock> mHalMock;
-    sp<VehiclePropertiesHolder> mPropertiesForMocking;
-    sp<MockDeathHandler> mHalMockDeathHandler;
-};
-
-};
-
-#endif /* CAR_VEHICLE_NETWORK_SERVICE_H_ */
diff --git a/vehicle_network_service/VehiclePropertyAccessControl.cpp b/vehicle_network_service/VehiclePropertyAccessControl.cpp
deleted file mode 100644
index 4adb55f..0000000
--- a/vehicle_network_service/VehiclePropertyAccessControl.cpp
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * 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 "VehiclePropertyAccessControl"
-#include <string>
-#include <stdint.h>
-#include <sys/types.h>
-#include <IVehicleNetwork.h>
-#include "VehiclePropertyAccessControl.h"
-#include <hardware/vehicle.h>
-#include <private/android_filesystem_config.h>
-#include <vehicle-internal.h>
-
-//#define DBG_EVENT
-//#define DBG_VERBOSE
-#ifdef DBG_EVENT
-#define EVENT_LOG(x...) ALOGD(x)
-#else
-#define EVENT_LOG(x...)
-#endif
-#ifdef DBG_VERBOSE
-#define LOG_VERBOSE(x...) ALOGD(x)
-#else
-#define LOG_VERBOSE(x...)
-#endif
-
-
-namespace android {
-
-VehiclePropertyAccessControl::VehiclePropertyAccessControl() {
-}
-
-VehiclePropertyAccessControl::~VehiclePropertyAccessControl() {
-    int index;
-    int size;
-
-    for (auto& i: mVehicleAccessControlMap) {
-        delete(&i);
-    }
-
-    mVehicleAccessControlMap.clear();
-}
-
-// Returns true if the given string, s, is a hex number that starts with 0x.
-// Otherwise false is returned.
-bool VehiclePropertyAccessControl::isHexNotation(std::string const& s) {
-    return s.compare(0, 2, "0x") == 0
-            && s.size() > 2
-            && s.find_first_not_of("0123456789abcdefABCDEF", 2)
-            == std::string::npos;
-}
-
-// Converts the string representation, access, to an integer form and store it
-// in value. true is returned if the parameter, access, is "r", "w", "rw" or
-// "wr". Otherwise false is returned. The parameters property and uid are
-// only used for logging in the event that the string, access, was not
-// recognized.
-bool VehiclePropertyAccessControl::accessToInt(int32_t* const value,
-                                               const xmlChar* property,
-                                               const xmlChar* uid,
-                                               const xmlChar* access) {
-    if (!value || !property || !uid || !access) {
-        ALOGE("Internal Error\n");
-        return false;
-    }
-
-    if (xmlStrcmp(access, (const xmlChar *)"r") == 0) {
-        *value = VEHICLE_PROP_ACCESS_READ;
-    }
-    else if (xmlStrcmp(access, (const xmlChar *)"w") == 0) {
-        *value = VEHICLE_PROP_ACCESS_WRITE;
-    }
-    else if ((xmlStrcmp(access, (const xmlChar *)"rw") == 0)
-            || (xmlStrcmp(access, (const xmlChar *)"wr") == 0)) {
-        *value = VEHICLE_PROP_ACCESS_READ_WRITE;
-    }
-    else {
-        ALOGE("Unknown access tag %s for UID %s in PROPERTY %s\n",access, uid,
-              property);
-        return false;
-    }
-
-    return true;
-}
-
-// Adds the property/uid pair to the mVehicleAccessControlMap map if the pair
-// doesn't already exist. If the pair does exist, the access is updated.
-bool VehiclePropertyAccessControl::updateOrCreate(int32_t uid, int32_t property,
-                                                  int32_t access) {
-    // check if property exists
-    if (mVehicleAccessControlMap.count(property) == 0) {
-        std::map<int32_t, int32_t>* uid_access =
-                new std::map<int32_t, int32_t>();
-        mVehicleAccessControlMap[property] = uid_access;
-    }
-
-    // Get the propertyAccessMap
-    std::map<int32_t, int32_t>* uidAccessMap =
-            mVehicleAccessControlMap[property];
-
-    // Now check if uid exists
-    if (uidAccessMap->count(uid) == 0) {
-        (*uidAccessMap)[uid] = access;
-        // uid was not found
-        return false;
-    }
-
-    // The Property, Uid pair exist. So update the access
-    (*uidAccessMap)[uid] = access;
-
-    return true;
-}
-
-// Start parsing the xml file and populating the mVehicleAccessControlMap
-// map. The parameter, a_node, must point to the first <PROPERTY> tag.
-// true is returned if the parsing completed else false.
-bool VehiclePropertyAccessControl::populate(xmlNode * a_node) {
-    xmlNode* cur_node = NULL;
-    xmlNode* child = NULL;
-    xmlChar* property = NULL;
-    xmlChar* property_value_str = NULL;
-    xmlChar* uid = NULL;
-    xmlChar* uid_value_str = NULL;
-    xmlChar* access = NULL;
-    int32_t property_value;
-    int32_t uid_value;
-    int32_t access_value;
-
-    if (!a_node) {
-        ALOGE("Internal Error");
-        return false;
-    }
-
-    // Loop over all the PROPERTY tags
-    for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
-        if ((xmlStrcmp(cur_node->name, (const xmlChar *)"PROPERTY") == 0) &&
-                (cur_node->type == XML_ELEMENT_NODE)) {
-            // Free the old property tag
-            xmlFree(property);
-            // get new property tag name attribute
-            property = xmlGetProp(cur_node, (const xmlChar *)"name");
-            if (!property) {
-                ALOGE("PROPERTY given without name attribute");
-                continue;
-            }
-
-            // get new property tag value attribute
-            property_value_str = xmlGetProp(cur_node, (const xmlChar*)"value");
-            if (!property_value_str) {
-                ALOGE("PROPERTY given without value attribute");
-                continue;
-            }
-
-            std::string tmp_str((const char*)property_value_str);
-            if (isHexNotation(tmp_str)) {
-                property_value = std::stoul(tmp_str, nullptr, 16);
-            } else {
-                property_value = std::stoul(tmp_str, nullptr, 10);
-            }
-
-            // property with this set to true will not call get when it is subscribed.
-            property_value_str = xmlGetProp(cur_node, (const xmlChar*)"no_auto_get");
-            if (property_value_str) {
-                if (xmlStrcmp(property_value_str, (const xmlChar*)"true")==0) {
-                    mPropertiesWithNoAutoGet.insert(property_value);
-                }
-            }
-
-            // Loop over all UID tags
-            for (child = cur_node->children; child; child = child->next) {
-                if ((xmlStrcmp(child->name, (const xmlChar*)"UID")==0) &&
-                        (child->type == XML_ELEMENT_NODE)) {
-                    if (property != NULL) {
-                        // Free the old uid tag
-                        xmlFree(uid);
-                        // Free the old access tag
-                        xmlFree(access);
-                        // get new uid tag
-                        uid = xmlGetProp(child, (const xmlChar*)"name");
-                        // get new uid tag
-                        uid_value_str = xmlGetProp(child,
-                                                   (const xmlChar*)"value");
-                        // get new access tag
-                        access = xmlGetProp(child, (const xmlChar *)"access");
-
-                        if (uid == NULL) {
-                            ALOGE(
-                                "UID tag for property %s given without name attribute\n",
-                                property);
-                        } else if (uid_value_str == NULL) {
-                            ALOGE(
-                                "UID tag for property %s given without value attribute\n",
-                                property);
-                        } else if (access == NULL) {
-                            ALOGE(
-                                "UID tag for property %s given without access attribute\n",
-                                property);
-                        } else {
-                            std::string tmp_str((const char *)uid_value_str);
-                            if (isHexNotation(tmp_str)) {
-                                uid_value = std::stoul(tmp_str, nullptr, 16);
-                            } else {
-                                uid_value = std::stoul(tmp_str, nullptr, 10);
-                            }
-
-                            bool re1 = accessToInt(&access_value, property, uid,
-                                                   access);
-                            if (re1) {
-                                if (!updateOrCreate(uid_value, property_value,
-                                                    access_value)) {
-                                    LOG_VERBOSE(
-                                        "Property %08x was added: uid=%d access=%d\n",
-                                        property_value, uid_value, access_value);
-                                } else {
-                                    LOG_VERBOSE("Property %08x was updated: uid=%d access=%d\n",
-                                          property_value, uid_value, access_value);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    xmlFree(property);
-    xmlFree(uid);
-    xmlFree(access);
-
-    return true;
-}
-
-// This method initializes the class by parsing the mandatory
-// /system/etc/vns/vns_policy.xml file and then the optional
-// /system/etc/vns/vendor_vns_policy.xml if found.
-// false is returned if vns_policy.xml was not found or is
-// invalid else true is returned.
-bool VehiclePropertyAccessControl::init() {
-    static const char* default_policy = "/system/etc/vns/vns_policy.xml";
-    static const char* vendor_policy = "/system/etc/vns/vendor_vns_policy.xml";
-
-    if (!process(default_policy)) {
-        return false;
-    }
-
-    if (process(vendor_policy)) {
-        ALOGE("Vendor VNS Policy was applied\n");
-    }
-
-    return true;
-}
-
-// Processes the vns_policy.xml or vendor_vns_policy.xml files
-// and returns true on success else false is returned.
-bool VehiclePropertyAccessControl::process(const char* policy) {
-    xmlDoc* doc = NULL;
-    xmlNode* root_element = NULL;
-
-    doc = xmlReadFile(policy, NULL, 0);
-    if (doc == NULL) {
-        ALOGE("Could not find %s\n", policy);
-        return false;
-    }
-
-    root_element = xmlDocGetRootElement(doc);
-    if (!root_element) {
-        ALOGE("Not a valid config file %s\n", policy);
-        xmlFreeDoc(doc);
-        return false;
-    }
-
-    if (xmlStrcmp(root_element->name, (const xmlChar *)"ALLOW") != 0) {
-        ALOGE("Not a valid config file %s\n", policy);
-        xmlFreeDoc(doc);
-        return false;
-    }
-
-    bool ret = populate(root_element->children);
-
-    xmlFreeDoc(doc);
-
-    return ret;
-}
-
-void VehiclePropertyAccessControl::dump(String8& msg) {
-    std::string perm;
-    int32_t property;
-    int32_t uid;
-    int32_t access;
-    std::map<int32_t, int32_t> *uid_access_map;
-
-    for (auto& i: mVehicleAccessControlMap) {
-        property = i.first;
-        uid_access_map = mVehicleAccessControlMap[property];
-        for (auto& j: *uid_access_map) {
-            uid = j.first;
-            access = (*uid_access_map)[uid];
-            switch(access) {
-                case VEHICLE_PROP_ACCESS_READ: perm = "read"; break;
-                case VEHICLE_PROP_ACCESS_WRITE: perm = "write"; break;
-                case VEHICLE_PROP_ACCESS_READ_WRITE: perm = "read/write"; break;
-                default: perm="unknown";
-            }
-            msg.appendFormat("UID %d: property 0x%08x, access %s\n", uid,
-                             property, perm.c_str());
-        }
-    }
-}
-
-// Test if the given uid has (read or write) access to the given property. If it
-// does, true is returned and false is returned if it doesn't have access or the
-// property or uid is unknown.
-bool VehiclePropertyAccessControl::testAccess(int32_t property, int32_t uid,
-                                              bool isWrite) {
-    // Check if the property exists
-    if (mVehicleAccessControlMap.count(property) == 0) {
-        // property was not found
-        return false;
-    }
-
-    // Get the uidAccessMap
-    std::map<int32_t, int32_t>* uidAccessMap =
-            mVehicleAccessControlMap[property];
-
-    // Now check if uid exists
-    if (uidAccessMap->count(uid) == 0) {
-        // uid was not found
-        return false;
-    }
-
-    // Get Access to this Property
-    int32_t access = (*uidAccessMap)[uid];
-
-    // Test if the UID has access to the property
-    if (isWrite) {
-        if ((access == VEHICLE_PROP_ACCESS_WRITE)
-                || (access == VEHICLE_PROP_ACCESS_READ_WRITE)) {
-            return true;
-        } else {
-            return false;
-        }
-    } else {
-        if ((access == VEHICLE_PROP_ACCESS_READ)
-                || (access == VEHICLE_PROP_ACCESS_READ_WRITE)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-}
-
-bool VehiclePropertyAccessControl::isAutoGetEnabled(int32_t property) {
-    return mPropertiesWithNoAutoGet.count(property) == 0;
-}
-
-};
diff --git a/vehicle_network_service/VehiclePropertyAccessControl.h b/vehicle_network_service/VehiclePropertyAccessControl.h
deleted file mode 100644
index e57ebcd..0000000
--- a/vehicle_network_service/VehiclePropertyAccessControl.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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 CAR_VEHICLE_PROPERTY_ACCESS_CONTROL_H_
-#define CAR_VEHICLE_PROPERTY_ACCESS_CONTROL_H_
-
-#include <utils/String8.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <map>
-#include <set>
-#include <string>
-#include <private/android_filesystem_config.h>
-#include <vehicle-internal.h>
-
-namespace android {
-// This class is used to gate access to properties that are defined in an XML
-// file. The property are read from /system/etc/vns/vns_policy.xml and this xml
-// file must exist. If not, an error is generated. If the optional
-// vendor_vns_policy.xml file is found in the same directory, properties from
-// that file are also loaded to extend or override the properties from the
-// vns_policy.xml file.
-class VehiclePropertyAccessControl {
-public:
-    VehiclePropertyAccessControl();
-    virtual ~VehiclePropertyAccessControl();
-    bool init();
-    bool testAccess(int32_t property, int32_t uid, bool isWrite);
-    bool isAutoGetEnabled(int32_t property);
-    void dump(String8& msg);
-// protected for testing
-protected:
-    bool isHexNotation(std::string const& s);
-    bool accessToInt(int32_t* const value,const xmlChar* property,
-                   const xmlChar* uid, const xmlChar* access);
-    bool updateOrCreate(int32_t uid, int32_t property, int32_t access);
-    bool populate(xmlNode* a_node);
-    bool process(const char* policy);
-// protected for testing
-protected:
-    // mVehicleAccessControlMap uses "property" as a key to map to map<int,int>*
-    //
-    // map<int,int> uses "uid" as a key to map to an integer that represents
-    // "access"
-    //
-    // So "property" is used to find "uid" and "uid" is used to find "access".
-    std::map<int32_t, std::map<int32_t, int32_t>*> mVehicleAccessControlMap;
-    std::set<int32_t> mPropertiesWithNoAutoGet;
-};
-
-};
-
-#endif /* CAR_VEHICLE_NETWORK_PROPERTY_CONFIG_H_ */
diff --git a/vehicle_network_service/main_vehiclenetwork.cpp b/vehicle_network_service/main_vehiclenetwork.cpp
deleted file mode 100644
index 12416b5..0000000
--- a/vehicle_network_service/main_vehiclenetwork.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2015 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 "VNS"
-
-#include <signal.h>
-
-#include <binder/IServiceManager.h>
-#include <utils/Log.h>
-
-#include "VehicleNetworkService.h"
-
-using namespace android;
-
-int main(int /*argc*/, char** /*argv*/)
-{
-    ALOGI("vehicle_network_service: starting");
-    signal(SIGPIPE, SIG_IGN);
-    // this will wait for service manager if not available yet.
-    sp<IServiceManager> sm = defaultServiceManager();
-    VehicleNetworkService::instantiate();
-    ProcessState::self()->startThreadPool();
-    IPCThreadState::self()->joinThreadPool();
-}
diff --git a/vns_policy/Android.mk b/vns_policy/Android.mk
deleted file mode 100644
index 7b5f2c6..0000000
--- a/vns_policy/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2015 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)
-##################################
-# vns_policy.xml
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := vns_policy.xml
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/vns
-
-include $(BUILD_PREBUILT)
diff --git a/vns_policy/vns_policy.xml b/vns_policy/vns_policy.xml
deleted file mode 100644
index 7fc5fc8..0000000
--- a/vns_policy/vns_policy.xml
+++ /dev/null
@@ -1,399 +0,0 @@
-<!-- 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.
-    /
-
-    //Autogenerated from vehicle.h using tools/vns_policy_gen.py.
-    //Do not modify manually.
--->
-
-<ALLOW>
-  <PROPERTY name="VEHICLE_PROPERTY_INVALID" value = "0x0">
-    <!--  Property 0 write is used to allow hal mocking -->
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-    <UID name="AID_AUDIOSERVER" access="r" value="1041"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INFO_VIN" value="0x00000100">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INFO_MAKE" value="0x00000101">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INFO_MODEL" value="0x00000102">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INFO_MODEL_YEAR" value="0x00000103">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INFO_FUEL_CAPACITY" value="0x00000104">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_PERF_ODOMETER" value="0x00000204">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_PERF_VEHICLE_SPEED" value="0x00000207">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_ENGINE_COOLANT_TEMP" value="0x00000301">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_ENGINE_OIL_TEMP" value="0x00000304">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_ENGINE_RPM" value="0x00000305">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_GEAR_SELECTION" value="0x00000400">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_CURRENT_GEAR" value="0x00000401">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_PARKING_BRAKE_ON" value="0x00000402">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_DRIVING_STATUS" value="0x00000404">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_FUEL_LEVEL_LOW" value="0x00000405">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_NIGHT_MODE" value="0x00000407">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_FAN_SPEED" value="0x00000500">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_FAN_DIRECTION" value="0x00000501">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_TEMPERATURE_CURRENT" value="0x00000502">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET" value="0x00000503">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_DEFROSTER" value="0x00000504">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_AC_ON" value="0x00000505">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_MAX_AC_ON" value="0x00000506">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_MAX_DEFROST_ON" value="0x00000507">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_RECIRC_ON" value="0x00000508">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_DUAL_ON" value="0x00000509">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_AUTO_ON" value="0x0000050A">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_SEAT_TEMPERATURE" value="0x0000050B">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_SIDE_MIRROR_HEAT" value="0x0000050C">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_STEERING_WHEEL_TEMP" value="0x0000050D">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_TEMPERATURE_UNITS" value="0x0000050E">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_ACTUAL_FAN_SPEED_RPM" value="0x0000050F">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_POWER_ON" value="0x00000510">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HVAC_FAN_DIRECTION_AVAILABLE" value="0x00000511">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_ENV_OUTSIDE_TEMPERATURE" value="0x00000703">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_ENV_CABIN_TEMPERATURE" value="0x00000704">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_RADIO_PRESET" value="0x00000801">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_FOCUS" value="0x00000900">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-    <UID name="AID_AUDIOSERVER" access="r" value="1041"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_VOLUME" value="0x00000901" no_auto_get="true">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT" value="0x00000902" no_auto_get="true">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY" value="0x00000903">
-    <UID name="AID_SYSTEM" access="w" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_HW_VARIANT" value="0x00000904">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_HINT" value="0x00000905">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AP_POWER_STATE" value="0x00000A00">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_DISPLAY_BRIGHTNESS" value="0x00000A01">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_AP_POWER_BOOTUP_REASON" value="0x00000A02">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_HW_KEY_INPUT" value="0x00000A10">
-    <UID name="AID_SYSTEM" access="r" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_INSTRUMENT_CLUSTER_INFO" value="0x00000A20">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_UNIX_TIME" value="0x00000A30">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_CURRENT_TIME_IN_SECONDS" value="0x00000A31">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_DOOR_POS" value="0x00000B00">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_DOOR_MOVE" value="0x00000B01">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_DOOR_LOCK" value="0x00000B02">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_Z_POS" value="0x00000B40">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_Z_MOVE" value="0x00000B41">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_Y_POS" value="0x00000B42">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_Y_MOVE" value="0x00000B43">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_LOCK" value="0x00000B44">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_MIRROR_FOLD" value="0x00000B45">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_MEMORY_SELECT" value="0x00000B80">
-    <UID name="AID_SYSTEM" access="w" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_MEMORY_SET" value="0x00000B81">
-    <UID name="AID_SYSTEM" access="w" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BELT_BUCKLED" value="0x00000B82">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_POS" value="0x00000B83">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_MOVE" value="0x00000B84">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_FORE_AFT_POS" value="0x00000B85">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_FORE_AFT_MOVE" value="0x00000B86">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_POS" value="0x00000B87">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_MOVE" value="0x00000B88">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_POS" value="0x00000B89">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_MOVE" value="0x00000B8A">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEIGHT_POS" value="0x00000B8B">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEIGHT_MOVE" value="0x00000B8C">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_DEPTH_POS" value="0x00000B8D">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_DEPTH_MOVE" value="0x00000B8E">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_TILT_POS" value="0x00000B8F">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_TILT_MOVE" value="0x00000B90">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_POS" value="0x00000B91">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_MOVE" value="0x00000B92">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_POS" value="0x00000B93">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_MOVE" value="0x00000B94">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_POS" value="0x00000B95">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_MOVE" value="0x00000B96">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_POS" value="0x00000B97">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_MOVE" value="0x00000B98">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_POS" value="0x00000B99">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_MOVE" value="0x00000B9A">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_WINDOW_POS" value="0x00000BC0">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_WINDOW_MOVE" value="0x00000BC1">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_WINDOW_VENT_POS" value="0x00000BC2">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_WINDOW_VENT_MOVE" value="0x00000BC3">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-  <PROPERTY name="VEHICLE_PROPERTY_WINDOW_LOCK" value="0x00000BC4">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-  </PROPERTY>
-
-<!-- Internal Vehicle Properties -->
-
-  <PROPERTY name="VEHICLE_PROPERTY_INTERNAL_AUDIO_STREAM_STATE" value="0x74000000">
-    <UID name="AID_SYSTEM" access="rw" value="1000"/>
-    <UID name="AID_AUDIOSERVER" access="w" value="1041"/>
-  </PROPERTY>
-
-</ALLOW>