summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/app_service_rpc_plugin
Commit message (Collapse)AuthorAgeFilesLines
* Fix LastState methods thread safe access (#2626)Ira Lytvynenko (GitHub)2020-02-143-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix LastState instance thread safe access Fix LastState instance thread safe access and update dictionary usages in app launch and resumption. There was implemented LastStateWrapper class for providing exclusive thread safe access to LastState instance from all places in the program. Also passing LastState object was replaced with LastStateWrapper object to avoid direct access to LastState instance from another components. Thus there were a small updates in architecture of AM and TM classes. * Fixed mocks and unit tests related to LastState class * Add LastStateWrapper interface and LastStateWrapperPtr typedef * Fix tests after adding LastStateWrapper interface * Deprecate methods with changed signature * Adapt RCConsentManager according to LastState functionality There are some deprecated methods in LastState that are used by RCConsentManager. In addition, LastState::dictionary method returns reference to dictionary no more - only copy of latter. * Adapt AppServiceManager to new LastState usage * Adapt transport manager to new LastState usage * Adapt RPCPlugin to new LastState usage * Adapt AppServiceRPCPlugin to new LastState usage * Adapt RCRPCPlugin to new LastState usage * Adapt SDLRPCPlugin to new LastState usage * Adapt VehicleInfoPlugin to new LastState usage * Adapt existing unit tests * Fix ENABLE_LOG off build failure * Replace old-style loops with range based * Fix potential mutex deadlocks in resumption storage * Add Mutable Data Accessor. The entity that provides the thread-safe mutable access to data. * Fix submodule issues after merge Co-authored-by: Alexander Kutsan (GitHub) <akutsan@luxoft.com> Co-authored-by: Yaroslav Mamykin (GitHub) <33784535+YarikMamykin@users.noreply.github.com> Co-authored-by: Igor Gapchuk (GitHub) <41586842+IGapchuk@users.noreply.github.com> Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com>
* Fix app service extension resumption data processing (#3097)6.0.0_RC2release/6.0.0Yaroslav Mamykin (GitHub)2019-10-286-1/+278
| | | | | | | | | | | | | | | | | | | | | | * Add unit tests * Fix subscription to app services * fixup! Fix subscription to app services * fixup! Add unit tests * fixup! Add unit tests * fixup! Fix subscription to app services * fixup! Fix subscription to app services * fixup! Add unit tests * fixup! Add unit tests * fixup! Add unit tests
* Make usage logger stabilization (#3022)Serhii Niukalov (GitHub)2019-09-191-1/+2
| | | | | | | | Added custom deleter for logger Added flush logger during each handle deleting Added deleting logger thread during destroy each plugin This changes are necessary to avoid deadlock during work with log4cxx.
* Feature/Remote Control - Allow Multiple Modules per Module Type (#2984)Ira Lytvynenko (GitHub)2019-08-302-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add new functionality to the interfaces * Add moduleId processing to the resource allocation manager Add GetResources function to helpers to get a list of resources Update unit tests with moduleID param Update command tests after updating the resource allocation manager * Add GetAcquiredModuleTypes and ReleaseModuleType functions for policy checking * Remove redundant SetResourceState call and fix UTs SetResourceState is called in RCCommandRequest::on_event function so it makes no sense to call it again RCCommandRequest::on_event * Add moduleInfo to default capabilities * Add ModuleId method to RCCommandRequest Add ModuleId method to RCCommandRequest for extracting module_id from command message. Update all inherited commands from RCCommandRequest. * Add ReleaseInteriorVehicleDataModule RPC Add ReleaseInteriorVehicleDataModuleRequest. Add ReleaseInteriorVehicleDataModuleResponse. Update ResourceAllocationManager interface: - add method ReleaseResource(); Update ResourceAllocationManagerImpl: - move ReleaseResource() from private section to public for implementing interface; * Add GetInteriorVehicleDataConsentRequest RPC Add GetInteriorVehicleDataConsentRequest without logic. Add GetInteriorVehicleDataConsentResponse. Update RCCommandFactory. * Refactor RC capabilities checking Create RCCapabilities manager, move all functions related to capabilities checking from commands into it. Move auxiliary functions to the rc_helpers. Create mock for RC capabilities manager Update UTs after RC capabilities manager adding * Use range based loop for smart objects with array type * Add ModuleId() function implementation Add const to the ModuleType() function Add function to get the moduleId from hmi capabilities Process missing moduleId param in HMI response In case if HMI doesn't provide the moduleId in response SDL will consider such response as invalid and send generic error response to the mobile Add moduleId to the hmi request * Add moduleId validation by capabilities and button_name for ButtonPress * Add moduleId validation by capabilities for GetIVD and SetIVD Add capabilities check to the rc_command_request * Add const to the capabilities check functions * Add function to get list of all available resources from hmi capabilities * Fix UTs after updating the capabilities check Update unit tests after obtaining available resources from capabilities * Add new HMI RPC SetGlobalProperties and save user_location of application Update SetGlobalPropertiesRequest - update PrepareResponseParameters method according to third new parameter "rc_properties"; * Add new parameter to ini file Add period for module_id consent expiring * Update interior vehicle data caching with moduleId processing Update unit tests that are related to caching with moduleId processing * Add separate file for RCRpcTypes * Add RCConsentManager - add interface RCConsetnManager - add implementation RCConsentManagerImpl - add new rc constants - add mock class for RCConsentManager Remove all consents after RC disabling Add checking ModuleConsent to RCCommandRequest Add logic for GetInteriorVehicleDataConsentRequest from Mobile Save the driver's decision when SDL sends the GIVDConsent request * Define Grid, add functions for getting moduleServiceArea and allowMultipleAccess values Add Seat Location capabilities checking and function for getting driver's location Check if the user location area and the service area has something in common, or the user location is driver, otherwise - reject the module reallocation request Fix UTs after adding the location check * Update SEAT module type processing Add converting id to moduleId: If the vehicle support at least one seat control, seat control capability includes at least two items. 1st for driver’s seat. 2nd for front passenger’s seat * Add SetGlobalProperties Unit tests Add Unit test for PrepareResultCodeForResponse method Add Unit test for PrepareResultForMobileResponse method * Add ReleaseInteriorVehicleDataModuleRequest Unit tests * Set resource to free if SIVD request is invalid * Add Grid Unit tests * Add ResourceAllocationManager Unit tests * Add MockRCHelpers. * Add ResourceAllocationManager Unit tests * Allocate resource after receiving successful response from HMI Send OnRCStatus notification only in case resource allocation state was changed * Rename function to indicate that it returns a list of module types * Rename typedef to indicate that it defines a pair moduleType and capabilitiesStatus * Fix functions descriptions * Rename function to indicate that it returns data related to the module type * Fix CheckIfModuleExistsInCapabilities function name * Update cached consents logic for GIVDC Behavior for cache consents has been updated according to the following comment: 1. If accessMode=AUTO_ALLOW, return true by default 2. If accessMode=AUTO_DENY, check if another app is using the resource a. If the resource is IN_USE, return false b. If the resource is FREE, return true 3. If accessMode=ASK_DRIVER, check if the consent is cached a. If it is cached, return that result b. If it is NOT cached, then prompt the driver for consent * Update logic for allowMultipleAccess=false
* [SDL 0173] - Read Generic Network Signal Data Implementation (#2977)Alexander Kutsan (GitHub)2019-08-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Generate policy enums from MOBILE_API Policy manager HMI level enum reorder * Add RPC vehicle data and endpoint_properties to sdl_preloaded_pt Set default version of custom vehicle data mapping * Add VehicleDataItem to policy table SQL storage implementation for VehicleDataItems Fix validation of double values in policy table Change isDouble to isNumeric during validation double values "0" should be validated as correct double value Add validation vehicle data during PTU Send in PT snapshot only version of custom VDI - During snapshot generation remove vehicle data items section - Add validation for Policy table depended on PT type Fix wrong check for vehicle data snapshot Allow empty vehicle data in PTU Change max value of string for URL from 255 to INT_MAX * Make Policy Handler forward declared to avoid high coupling * Add vehicle_info_command_params for vehicle info plugin Vehicle info params added to hmi commands * Process CustomVehicleData in GetVehicleData request * CustomVehicleDataManager implementation * Process Custom vehicle data subscriptions Refactored code. Extracted CheckFrequency to separate method in class * Check update of content of functional groups Fixes https://github.com/smartdevicelink/sdl_core/issues/2962 Add additional check for functional group content before OnPermissionChangeNotification. * rename comparing functions to make more clear their return value sense * change variable names * extra check for null values in HasNewGroups() New unit test to cover changes within functional group * Add GetPolicyConfigurationData GetPolicyCOnfigurationData Implementation * Add CustomVehicleData functionality for POLICY_EXTERNAL flow Change max value url for external policy fixes for external flow * since unti validation for the database * empty vehicle data validation * Convert data_type to VehicleDataType enum value * Validation of VehicleDataItem name and key Introduces validation of vehicle_data_item name and key validation: * they should not contain spaces; * they should not be empty or consist only spaces; * they should not contain invalid chars like '!@#$%^&*'. * Add engineOilLife to HMI_API * Remove deprecated RPC GetUrls due to major version update * Add ability to extend Smart schema with parameters Extract SMember from CObjectSchemaItem Add methods to ISchemaItem (Using composite pattern) - GetMemberSchemaItem - AddMemberSchemaItem Add implementation of VehicleDataItemSchema class Add appropriate unit tests Add creation of vehicle_data items schemes on policy event
* Fix shutdown crash static var colission (#2939)Alexander Kutsan (GitHub)2019-08-224-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add apropriate destruction of plugins Add Delete exported function to each rpc plugin library Delete funciton will destroy Plugin instance. Move type defenition of PluginPtr to Plugin manager, because other components should use olugins only by referance. Add custom destructor for PluginPtr. custom destructor will call `Delete` function from shared library for plugin instance and unload plugin dl_handle. Deprecate GetPlugins method because it not used (and actualy shouldnt) by other components. Refactored LoadPlugin function, make it more readable, make this function as private RPCPluginManagerImpl private method. * Fix components dependencies after hiding libraries symbols * Add `-fvisibility=hidden` to avoid collision of static variables Remove from ABI all shared objects members except functions that needed. Fixes double destruction crash on shutdown. For the case if dynamically linked library contains same static variables as binary. System allocates the same memory for both static variables (in shared object and in binary). But during exit both binary and shared object destroying this memory. Mostly is a specific for binaries generated by gcc compiler. Inspired by https://stackoverflow.com/questions/3570355/c-fvisibility-hidden-fvisibility-inlines-hidden http://gcc.gnu.org/wiki/Visibility * Link Policy code statically SDL components like Application manager Connection Handler, etc ... requires symbols from policy library. Also policy library loaded by SDL in run-time as shared library. Having same library loaded as dynamic and shared library is definitely bad idea. This commit link extract static policy component and link policy component statically to other components. * Static linkage of plugins code un plugins unit tests Unit tests need to be portable and should not depend from dynamic libraries * Put logs_enabled_ "default" visibility attribute Logs enables is static variable and it should be shared across libraries. On SDL start if set_enabled_logs should put value shared across libraries * Changed the order of destruction of objects Changed the order of destruction of objects to avoid the crash during destruction of the RequestController. * Change the order of the waiting and finishing thread Applications using hotplug support should stop the thread at program exit and wait finishing thread after calling libusb_hotplug_deregister_callback. This call wakes up libusb_handle_events () http://libusb.sourceforge.net/api-1.0/group__libusb__asyncio.html * fixup! Add apropriate destruction of plugins * Make saftly usage of logger Added usage unique_ptr for LogMessageLoopThread to avoid the crash when delete_log_message_loop_thread was not fired.
* Fix stylefeature/update_and_unpublish_app_serviceJackLivio2019-07-241-4/+4
|
* Update ↵JackLivio2019-07-231-1/+1
| | | | | src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc Co-Authored-By: Jacob Keeler <jacob.keeler@livioradio.com>
* Address commentsJackLivio2019-07-222-3/+3
|
* Address some commentsJackLivio2019-07-172-0/+23
|
* Compare service_id to default embedded serviceJackLivio2019-06-107-30/+38
| | | | Also fix style
* Merge branch 'develop' of github.com:smartdevicelink/sdl_core into ↵JackLivio2019-06-104-0/+30
|\ | | | | | | feature/update_and_unpublish_app_service
| * Get full media image pathJackLivio2019-06-044-0/+30
| |
* | Unpublish and Update App ServicesJackLivio2019-06-1013-7/+622
|/
* Merge remote-tracking branch 'origin/master' into developjacobkeeler2019-05-305-23/+333
|\ | | | | | | | | | | | | | | | | | | | | # Conflicts: # src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc # src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc # src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc # src/components/transport_manager/test/include/transport_manager/cloud/sample_websocket_server.h # src/components/transport_manager/test/sample_websocket_server.cc # src/components/transport_manager/test/transport_adapter_test.cc # src/components/transport_manager/test/websocket_connection_test.cc
| * Merge pull request #2931 from smartdevicelink/hotfix/service_data_image_pathsrelease/5.1.2Jacob Keeler2019-05-294-20/+324
| |\ | | | | | | Send full image paths to HMI in AppServiceData
| | * Send full image paths to HMI in AppServiceDatajacobkeeler2019-05-284-20/+324
| | |
| * | Fix creation of PublishAppService commandhotfix/publish_app_service_constructionjacobkeeler2019-05-291-4/+7
| |/
| * Add missing check in App Service Command Factoryjacobkeeler2019-05-221-3/+6
| |
* | Run updated style scriptjacobkeeler2019-04-2913-55/+67
|/
* Merge pull request #2894 from ↵Jacob Keeler2019-04-292-1/+69
|\ | | | | | | | | smartdevicelink/hotfix/on_app_service_data_error_cases Add checks for error cases in OnAppServiceData
| * Apply suggestions from code reviewhotfix/on_app_service_data_error_casesShobhit Adlakha2019-04-292-8/+8
| | | | | | Co-Authored-By: jacobkeeler <jacob.keeler@livioradio.com>
| * Add checks for error cases in OnAppServiceDatajacobkeeler2019-04-232-1/+69
| |
* | Apply suggestions from code reviewhotfix/reject_duplicate_servicesShobhit Adlakha2019-04-262-2/+2
| | | | | | Co-Authored-By: jacobkeeler <jacob.keeler@livioradio.com>
* | Prevent apps from publishing several services of the same typejacobkeeler2019-04-232-3/+19
|/
* Error Response for AppService.GetAppServiceData with unknown service ↵Shobhit Adlakha2019-04-091-14/+8
| | | | | | | | type/service id (#2880) * Added error response for AppService.GetAppServiceData request with unknown service type * Addressed review comments
* Add timeout logic for HMI App Service Consumer RPCsfix/no_hmi_response_on_timeoutjacobkeeler2019-04-014-0/+35
|
* Change is_foreground() usages to IsFullscreen()fix/is_foreground_usagesjacobkeeler2019-03-222-2/+2
|
* Address commentstests/app_service_command_testsJackLivio2019-03-171-5/+5
|
* Merge remote-tracking branch 'origin/develop' into ↵JackLivio2019-03-174-58/+311
|\ | | | | | | | | | | | | tests/app_service_command_tests # Conflicts: # src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt
| * Add null check for app in HandleSubscribefeature/app_service_manager_testsjacobkeeler2019-03-171-3/+2
| |
| * Fix build failure after mergejacobkeeler2019-03-171-0/+1
| |
| * Merge remote-tracking branch 'origin/develop' into ↵jacobkeeler2019-03-164-1/+324
| |\ | | | | | | | | | feature/app_service_manager_tests
| | * App service mobile and hmi command creation unit tests (#2843)Shobhit Adlakha2019-03-164-1/+324
| | | | | | | | | | | | | | | | | | * Created dummy_command_tests for app_service_rpc_plugin and added other App Service related RPCs * Set expectation that shared_ptr for command was succesfully created in dummy_command_tests
* | | Merge remote-tracking branch 'origin/feature/app_service_manager_tests' into ↵JackLivio2019-03-1614-37/+31
|\ \ \ | |/ / | | | | | | tests/app_service_command_tests
| * | Add safety checks in PerformAppServiceInteraction and GetAppServiceDatajacobkeeler2019-03-163-7/+26
| | |
| * | Fix style and add more testsjacobkeeler2019-03-161-2/+2
| | |
| * | Merge branch 'develop' into feature/app_service_manager_testsJacob Keeler2019-03-1612-28/+3
| |\ \ | | |/
| | * Merge pull request #2841 from ↵Jacob Keeler2019-03-1612-28/+3
| | |\ | | | | | | | | | | | | | | | | smartdevicelink/feature/cloud_app_auth_token_unit_tests Cloud app properties unit tests
| | | * Remove unused code and headersjacobkeeler2019-03-1112-28/+3
| | | |
| * | | API changes to app service managerjacobkeeler2019-03-161-1/+1
| | | |
* | | | Merge remote-tracking branch 'origin/feature/app_service_manager_tests' into ↵JackLivio2019-03-157-0/+14
|\ \ \ \ | |/ / / | | | | | | | | tests/app_service_command_tests
| * | | Rearrange includes and make AppServiceManager methods virtualjacobkeeler2019-03-157-0/+14
| | | |
* | | | OnAppServiceDataTestsJackLivio2019-03-143-1/+290
|/ / /
* | | Add mock app service managerjacobkeeler2019-03-142-5/+5
|/ /
* | Fix onAppServiceData from mobilefix/app_service_on_app_service_data_disallowedJackLivio2019-03-111-1/+1
|/
* Update preloaded PT and fix merge issuesfeature/base_app_services_implementationjacobkeeler2019-03-071-4/+0
|
* RPC Passing and Handling unknown RPC parameters (#2821)Shobhit Adlakha2019-03-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Merge remote-tracking branch ↵jacobkeeler2019-03-068-60/+52
|\ | | | | | | 'origin/feature/base_app_services_implementation' into feature/forwarded_request_timeout
| * Merge pull request #2827 from smartdevicelink/feature/protect_published_servicesJacob Keeler2019-03-064-18/+33
| |\ | | | | | | App Services Fixes