summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-10-24 17:24:35 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2019-10-24 17:24:35 -0400
commit09a13c71f930143346e80fdbffd945f09dc3fd3b (patch)
tree8cc497e1138e5a06d91d8ff7795f60d7ac8abdba
parent7c9b576774d78b3690eb27655ea525f7d4474a87 (diff)
downloadsdl_core-fix/vehicle_data_item_limits.tar.gz
Fix custom vehicle data limitsfix/vehicle_data_item_limits
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc
index b7dbdfdd9a..750da9fa6e 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc
@@ -121,32 +121,31 @@ smart_objects::ISchemaItemPtr VehicleDataItemSchema::GetPODTypeSchema(
using BoolItemParam = smart_objects::TSchemaItemParameter<bool>;
if (policy_item.type == policy_table::VehicleDataItem::kInteger) {
- return IntSchemaItem::create(
- IntItemParam(policy_item.minvalue.is_initialized()
- ? *policy_item.minvalue
- : std::numeric_limits<int64_t>::min()),
- IntItemParam(policy_item.maxvalue.is_initialized()
- ? *policy_item.maxvalue
- : std::numeric_limits<int64_t>::max()));
+ return IntSchemaItem::create(policy_item.minvalue.is_initialized()
+ ? IntItemParam(*policy_item.minvalue)
+ : IntItemParam(),
+ policy_item.maxvalue.is_initialized()
+ ? IntItemParam(*policy_item.maxvalue)
+ : IntItemParam());
}
if (policy_item.type == policy_table::VehicleDataItem::kFloat ||
policy_item.type == policy_table::VehicleDataItem::kDouble) {
return FloatSchemaItem::create(
- FloatItemParam(policy_item.minvalue.is_initialized()
- ? double(*policy_item.minvalue)
- : std::numeric_limits<double>::min()),
- FloatItemParam(policy_item.maxvalue.is_initialized()
- ? double(*policy_item.maxvalue)
- : std::numeric_limits<double>::max()));
+ policy_item.minvalue.is_initialized()
+ ? FloatItemParam(double(*policy_item.minvalue))
+ : FloatItemParam(),
+ policy_item.maxvalue.is_initialized()
+ ? FloatItemParam(double(*policy_item.maxvalue))
+ : FloatItemParam());
}
if (policy_item.type == policy_table::VehicleDataItem::kString) {
return StringSchemaItem::create(
StringItemParam(policy_item.minlength.is_initialized()
? *policy_item.minlength
: 0),
- StringItemParam(policy_item.maxlength.is_initialized()
- ? *policy_item.maxlength
- : std::numeric_limits<uint32_t>::max()));
+ policy_item.maxlength.is_initialized()
+ ? StringItemParam(*policy_item.maxlength)
+ : StringItemParam());
}
if (policy_item.type == policy_table::VehicleDataItem::kBoolean) {
return BoolSchemaItem::create(BoolItemParam(true));