vehicle hal refactoring from hal review

- call release_memory_from_get for freeing memory allocated
  from get call
- add retry for NOT_READY error which can happen at initial
  stage
- simplify zoned properties with missing multiple mins/maxs for
  zoned properties
- update HVAC API to return min/max values per each zone
- change HVACV API to return all zones available
  (renamed to getZones())
- fix missing write permision to property 0 which
  is used to gatekeep hal mocking

bug: 27597338, 27596281

Change-Id: I353acc0398f62c4933491e43592ea598d17d2422
diff --git a/libvehiclenetwork/native/IVehicleNetwork.cpp b/libvehiclenetwork/native/IVehicleNetwork.cpp
index d70a698..09da0ee 100644
--- a/libvehiclenetwork/native/IVehicleNetwork.cpp
+++ b/libvehiclenetwork/native/IVehicleNetwork.cpp
@@ -17,6 +17,7 @@
 #define LOG_TAG "VehicleNetwork"
 
 #include <memory>
+#include <string.h>
 
 #include <binder/IPCThreadState.h>
 
@@ -285,20 +286,22 @@
         } break;
         case GET_PROPERTY: {
             CHECK_INTERFACE(IVehicleNetwork, data, reply);
-            ScopedVehiclePropValue value;
-            r = VehiclePropValueBinderUtil::readFromParcel(data, &value.value,
+            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.value.prop, false)) {
+            if (!isOperationAllowed(value.prop, false)) {
                 return PERMISSION_DENIED;
             }
-            r = getProperty(&(value.value));
+            r = getProperty(&value);
             if (r == NO_ERROR) {
                 reply->writeNoException();
-                r = VehiclePropValueBinderUtil::writeToParcel(*reply, value.value);
+                r = VehiclePropValueBinderUtil::writeToParcel(*reply, value);
+                releaseMemoryFromGet(&value);
             }
             return r;
         } break;