diff options
author | Shobhit Adlakha <ShobhitAd@users.noreply.github.com> | 2019-03-07 21:43:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 21:43:31 -0500 |
commit | 3be4d6a8384f5422a040121c11b448a7dd6901fc (patch) | |
tree | eef53c493b759056158ac39b261fcd4e0519b7b3 /src/components/smart_objects/src | |
parent | 5cc1ad073dd9a05a3bd65499acf0c6b079287a29 (diff) | |
download | sdl_core-3be4d6a8384f5422a040121c11b448a7dd6901fc.tar.gz |
RPC Passing and Handling unknown RPC parameters (#2821)
* Initial app service app extension
* Add GetAppServiceData rpc templates.
* Add request to mobile, and fix HMI GASD naming
* Add Core->Mobile Requests and Responses
* HMI GetAppService Request/Response to hmi and from hmi.
* Add mobile on event handling
* Fix GASD Response From Mobile
* Add PerformAppServiceInteraction RPC
* Fixes for GetAppServiceData subscribe, and OnAppServiceData
Fixes allow for multiple consumers on a single app service type. Consumer/provider can be any combination of an ios app(s), android app(s), or an ivi HMI app(s).
* Update AppServicetype to string and fix unit tests
* Implemented RpcPassThroughTimeout param and IncreaseForwardedRequestTimeout function
* Address review comments
* Fixed build tests
* Fix style
* Address comments
* Address comments
* Pass info from provider in GASD response
* Implemented boolean paramter to keep/remove unknown RPC paramaters
* Added plugin keys
* Implemented allowing unknown rpc params if function is handled by AS plugin or is related to SystemCapability
* Implemented handling unknown params for OSCU notifications
* Fixed build tests
* Implemented handling unknown params for RPC Passing
* Initial implementation of RPC Passing
* fixed UNSUPPORTED_REQUEST case
* Moved RPCPassing implementation into seperate class
* Implemented passthrough request timeout
* Addressed style and formatting comments
* Put RPCPassingHandler in seperate file
* Removed unused request/response file (based on review comment r263121367)
* Fixed timeout implementation
* Created functions for handling forwarding requests/responses to core and mobile
* Moved Populating request queue functionality to seperate function
* Changed implementation to use one map with the original request and a queue of app service information
* Fixed timeout implementation
* Seperated RPCPassing checks from IsAppServiceRPC checks
* Added locks for request and timeout queues
* Addressed review comments
* Fixed rpc_passing_handler_ initializer and added comments
* Reduced scope of locks for rpc_passing_queue
Diffstat (limited to 'src/components/smart_objects/src')
4 files changed, 21 insertions, 17 deletions
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc index 7d5f8bcf84..be5fc2b83a 100644 --- a/src/components/smart_objects/src/array_schema_item.cc +++ b/src/components/smart_objects/src/array_schema_item.cc @@ -90,20 +90,21 @@ errors::eType CArraySchemaItem::validate( void CArraySchemaItem::applySchema( SmartObject& Object, - const bool RemoveFakeParameters, + const bool remove_unknown_parameters, const utils::SemanticVersion& MessageVersion) { if (SmartType_Array == Object.getType()) { for (size_t i = 0U; i < Object.length(); ++i) { mElementSchemaItem->applySchema( - Object[i], RemoveFakeParameters, MessageVersion); + Object[i], remove_unknown_parameters, MessageVersion); } } } -void CArraySchemaItem::unapplySchema(SmartObject& Object) { +void CArraySchemaItem::unapplySchema(SmartObject& Object, + const bool remove_unknown_parameters) { if (SmartType_Array == Object.getType()) { for (size_t i = 0U; i < Object.length(); ++i) { - mElementSchemaItem->unapplySchema(Object[i]); + mElementSchemaItem->unapplySchema(Object[i], remove_unknown_parameters); } } } diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc index 742c2ec353..b32757db7a 100644 --- a/src/components/smart_objects/src/object_schema_item.cc +++ b/src/components/smart_objects/src/object_schema_item.cc @@ -154,13 +154,13 @@ errors::eType CObjectSchemaItem::validate( void CObjectSchemaItem::applySchema( SmartObject& Object, - const bool RemoveFakeParameters, + const bool remove_unknown_parameters, const utils::SemanticVersion& MessageVersion) { if (SmartType_Map != Object.getType()) { return; } - if (RemoveFakeParameters) { + if (remove_unknown_parameters) { RemoveFakeParams(Object, MessageVersion); } @@ -173,16 +173,17 @@ void CObjectSchemaItem::applySchema( if (member.mSchemaItem->setDefaultValue(default_value)) { Object[key] = default_value; member.mSchemaItem->applySchema( - Object[key], RemoveFakeParameters, MessageVersion); + Object[key], remove_unknown_parameters, MessageVersion); } } else { member.mSchemaItem->applySchema( - Object[key], RemoveFakeParameters, MessageVersion); + Object[key], remove_unknown_parameters, MessageVersion); } } } -void CObjectSchemaItem::unapplySchema(SmartObject& Object) { +void CObjectSchemaItem::unapplySchema(SmartObject& Object, + const bool remove_unknown_parameters) { if (SmartType_Map != Object.getType()) { return; } @@ -191,7 +192,7 @@ void CObjectSchemaItem::unapplySchema(SmartObject& Object) { const std::string& key = it->first; // move next to avoid wrong iterator on erase ++it; - if (mMembers.end() == mMembers.find(key)) { + if (mMembers.end() == mMembers.find(key) && remove_unknown_parameters) { // remove fake params Object.erase(key); } @@ -202,7 +203,7 @@ void CObjectSchemaItem::unapplySchema(SmartObject& Object) { const std::string& key = it->first; const SMember& member = it->second; if (Object.keyExists(key)) { - member.mSchemaItem->unapplySchema(Object[key]); + member.mSchemaItem->unapplySchema(Object[key], remove_unknown_parameters); } } } diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc index 5e9358092a..fbab17f32d 100644 --- a/src/components/smart_objects/src/schema_item.cc +++ b/src/components/smart_objects/src/schema_item.cc @@ -51,10 +51,11 @@ bool ISchemaItem::hasDefaultValue(SmartObject& Object) { } void ISchemaItem::applySchema(SmartObject& Object, - const bool RemoveFakeParameters, + const bool remove_unknown_parameters, const utils::SemanticVersion& MessageVersion) {} -void ISchemaItem::unapplySchema(SmartObject& Object) {} +void ISchemaItem::unapplySchema(SmartObject& Object, + const bool remove_unknown_parameters) {} void ISchemaItem::BuildObjectBySchema(const SmartObject& pattern_object, SmartObject& result_object) {} diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc index f7cd22c4bc..dc0f1cbe31 100644 --- a/src/components/smart_objects/src/smart_schema.cc +++ b/src/components/smart_objects/src/smart_schema.cc @@ -52,13 +52,14 @@ void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) { } void CSmartSchema::applySchema(SmartObject& Object, - const bool RemoveFakeParameters, + const bool remove_unknown_parameters, const utils::SemanticVersion& MessageVersion) { - mSchemaItem->applySchema(Object, RemoveFakeParameters, MessageVersion); + mSchemaItem->applySchema(Object, remove_unknown_parameters, MessageVersion); } -void CSmartSchema::unapplySchema(SmartObject& Object) { - mSchemaItem->unapplySchema(Object); +void CSmartSchema::unapplySchema(SmartObject& Object, + const bool remove_unknown_parameters) { + mSchemaItem->unapplySchema(Object, remove_unknown_parameters); } void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object, |