summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix mutex deadlock on VR.ChangeLanguage received (#3370)Alexander Kutsan2020-09-031-5/+2
| | | | | | | | | | | | | | | * Fix mutex deadlock on VR.ChangeLanguage received SYNC-10345 There was a problem that on receiving VR.ChangeLanguage SDL is holding application lock via accessor and tries to send some notifications from the same thread. For sending notifications SDL should check policy permissions for that notification and hance, to acquire policy lock. At the same time, PTU could happen in the separate thread and during PTU policy lock could be acquired. Also, during PTU SDL will try to acquire applications lock from this thread, however it is acquired by another thread which executing VR.ChangeLanguage request. As a result we receive thread deadlock. To avoid this deadlock, accessor in VR.ChangeLanguage was scoped in the same manner as for UI and TTS parts. * Copy apps without redundant scoping data accessor Co-authored-by: Elvis Kuliiev <ekuliiev@luxoft.com> Co-authored-by: Aleksandr Kutsan <AKutsan@luxoft.com>
* Fix dangerous work with app commands (#3375)Alexander Kutsan (GitHub)2020-09-029-91/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * SDLCORE-665: Fix dangerous work with app commands SDLCORE-665 There was related to a thread safety violation while working with application internal commands array. This array is a thread safe itself as it is protected with mutexes, however FindCommand() function is returing a raw pointer to an internal array element so the external component is able to get access to this element at any time even without locking the mutex. Core crash which was found in DeleteCommand request instance is happening by exactly the same reason - DeleteCommand is using a raw pointer to find the command, however this command might be destroyed from another thread at this point of time. As a result, working thread can access to a destroyed object by pointer. As a quick solution, each FindCommand() was followed by a command accessor which prevents unexpected command destruction. Working thread will use the temporary copy of command, but not command itself. However, the better solution would be to change a design and to avoid using of the raw pointers. * Update an Application class methods to return by value instead of raw pointer Updates the next methods: FindCommand FindSubMenu FindChoiceSet Updates related logic and Unit tests * fixup! Update an Application class methods to return by value instead of raw pointer * fixup! Update an Application class methods to return by value instead of raw pointer * Review fix: log that submenu already exist instead of not found * fixup! Update an Application class methods to return by value instead of raw pointer Co-authored-by: ZhdanovP <pzhdanov@luxoft.com> Co-authored-by: Igor Gapchuk <igapchuck@luxoft.com>
* [SDL 0046] Implement logger abstraction (#3472)VladSemenyuk2020-09-01361-1878/+2318
| | | | | | | | | | | | | | | | | | | | | | | | * Implement logger abstraction. Integrate it to SDL. Create one logger instance for shared libraries * Rename all logger macros. * Update src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com> * Fix review comments(errors in log messages) * Fix review coments * Fix code style * Add logger variable creation to new commads * Fix review comment * Fixe review comment(class imblemtation moved to .cc file) Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
* [SDL 0273] WebEngine Projection mode (#3457)Alexander Kutsan (GitHub)2020-08-213-33/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Temporary commit. Changes rpc_spec submodule reference. NOTE: should be removed before merge * Update Mobile API for the new App HMI type WEB_VIEW * Update HMI API for the new App HMI type WEB_VIEW * Add app registration support of the hmi type WEB_VIEW * Update Unit tests related to app registration Add the new one case to check app registration with AppHMItype WEB_VIEW Update existing Application Manager UTs with the new methods for WEB_VIEW Update Application Mock * Add Unit tests for RAI request test * Implement HMI states management for WEP apps * Add new application exit reason RESOURCE_CONSTRAINT Add RESOURCE_CONSTRAINT to HMI API and its processing to OnExitApplicationNotification, update unit tests * Add web socket connection closing on RESOURCE_CONSTRAINT * Update ProtocolHandlerImpl::OnTMMessageSendFailed * Add Unit test for OnAppInterfaceUnregistedNotification * Remove redundant code * Add WEP media & nonmedia to general test cases * Move function to iface class to allow its testing * Add WEP media/nonmedia apps registration for HMI state checks Added unit test cases for WEP media and non-media applications, which allow to check HMI Level, system context, audio and video streaming states calculation after the following actions: - Initial HMI state after registration - HMI state after app activaion - HMI State after app deactivation - HMI state after app exit Note: HMI state includes HMI level, audio, video streaming state, system context * Make code more clear & easy for debug * Add test case for WEP app in resuming mode * Add missed logging * Close connection after RESOURCE_CONSTRAINT RESOURCE_CONSTRAINT unregister reason will close connection for all applications, but not only Web engine projection * Refactoring no functional changes Use setters instead of direct access to app_hmi_type bool var * Use PolicyHandler::CheckHMIType to avoid code duplication * Update src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc Co-authored-by: JackLivio <jack@livio.io> * Use log to check if web engine is allowed * fixup! Use log to check if web engine is allowed * Revert "fixup! Use log to check if web engine is allowed" This reverts commit baad4aae5ffdeba5502a533b2eeb18de84d92b05. * Revert "Use log to check if web engine is allowed" This reverts commit 94c6a7d9efc6912777834bb5aca22c7b46d43497. * Revert "Update src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc" This reverts commit 3296fcc399588f01624c1a27f64ab8bc9176e197. * Revert "Use PolicyHandler::CheckHMIType to avoid code duplication" This reverts commit 2c695099a63b838915cb9b5c91c46ad7fc013b47. * Use log string to check if WEB engine is not allowed * Update submodules Co-authored-by: Igor Gapchuk <igapchuck@luxoft.com> Co-authored-by: sniukalov <sniukaov@luxoft.com> Co-authored-by: Andriy Byzhynar (GitHub) <AByzhynar@luxoft.com> Co-authored-by: Mykhailo Vorobiov (GitHub) <61186891+mvorobio@users.noreply.github.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: JackLivio <jack@livio.io> Co-authored-by: YarikMamykin <ymamykin@gmail.com> Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com>
* Merge pull request #3478 from ↵JackLivio2020-08-201-0/+1
|\ | | | | | | | | smartdevicelink/fix/driver_distraction_capability_caching Cache Driver Distraction Capability
| * Cache Driver Distraction Capabilityfix/driver_distraction_capability_cachingjacobkeeler2020-08-191-0/+1
| |
* | Fix merge conflictsJackLivio2020-08-202-6/+2
| |
* | Merge remote-tracking branch 'origin/develop' into feature/main_menu_updatingJackLivio2020-08-2010-3/+824
|\ \ | |/ | | | | | | | | | | | | # Conflicts: # src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc # src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc # src/components/interfaces/HMI_API.xml # tools/rpc_spec
| * Add SubtleAlert RPC (#3459)Jacob Keeler2020-08-1710-3/+820
| | | | | | | | | | | | | | * Add SubtleAlert RPC to project * Add OnSubtleAlertPressed implementation * Add `subtle_notifications_per_minute_by_priority` field to policies
* | Get filename from full pathJackLivio2020-08-131-0/+7
| |
* | Merge remote-tracking branch 'origin/develop' into feature/main_menu_updatingJackLivio2020-08-125-9/+79
|\ \ | |/ | | | | | | # Conflicts: # tools/rpc_spec
| * Additional Submenus and Driver Distraction Limits (#3447)JackLivio2020-08-075-9/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement additional sub menus * Fix merge conflicts * Revert adding mobile api merge conflict * Update src/components/interfaces/HMI_API.xml Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com> * Update src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com> * Update src/components/application_manager/src/application_data_impl.cc Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com> * Update src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com> * Address comments * Fix unit tests * Fix conflitcs * Update src/components/interfaces/HMI_API.xml Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com> * Update commit hash Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com>
* | Apply suggestions from code reviewJackLivio2020-08-054-4/+4
| | | | | | Co-authored-by: Collin <iCollin@users.noreply.github.com>
* | Merge remote-tracking branch 'origin/develop' into feature/main_menu_updatingcollin2020-07-2335-164/+383
|\ \ | |/
| * allow button events to be forwarded to apps in LIMITED (#3461)Collin2020-07-232-4/+8
| | | | | | | | | | | | | | | | | | * allow button events to be forwarded to subscribed mobile apps in hmi level LIMITED for all buttons besides OK * fixup! allow button events to be forwarded to subscribed mobile apps in hmi level LIMITED for all buttons besides OK use existing var and clean up condition * fix description of OnButtonPress and OnButtonEvent param appID
| * [SDL 0249] Feature/persisting hmi capabilities (#3397)Yevhenii Dementieiev2020-07-1733-160/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replace raw pointers with shared pointers * Save UI.GetCapabilities, UI.GetLanguage, UI.GetSupportedLanguages responses into the file specified by ini file If ini file contains an empty path to the cache file, this feature will be disabled and SDL will work as before. SDL will save each response only first time, after that file will not be overwritten. On master reset SDL will remove the cache file. SDL will read default hmi capability values from the cache file on each system boot up * Fix doxygen * Define HMI interfaces aliases * Implement caching for VR, TTS, Buttons, VehicheInfo and RC capabilities * Fix default capabilities structure according to the HMI API * Send requests to get capabilities from HMI in case any capability is missing in cache * Refactor RC capabilities storing and retrieving. Fix related UTs. * Created implementation and unit tests for HMI capabilities persistence after SW update * Created implementation for save and received MetaInfo * Increase unit tests coverage on persistence HMI capabilities * Do not rewrite MetaInfo in case invalid BC.GetSystemInfo response from HMI * Read pcm_stream_capabilities from HMI and save to the cache * Refactor hmi capabilities test * Fix wrong convert PrerecordedSpeech and added unit test for check * Suspend response to RAI requests until HMI has responded to all the HMI capabilities * Request appropriate capabilities if they are not present in the cache and the default capabilities as well * fixup! Send requests to get capabilities from HMI in case any capability is missing in cache * Remove hm_capabilities.json test file It should be removed because during UT building the real hmi_capabilities.json file is copying to the test directory * Re-factor HMICapabilitiesImpl and add the new one method Make changes in the next places: - GetRequestsRequiredForCapabilities method rename to IsRequestsRequiredForCapabilities and return value change to bool. This commit provides the next implementation: the method checks if specified request should be sent to the HMI; - in the save_hmi_capability_field_to_json method remove redundant section in the json node to save; - JsonCapabilitiesGetter: GetInterfaceJsonMember method rename to IsInterfaceJsonMemberExists. Return value change to bool; - Add the new one function GetInterfaceGetter: returns the JsonCapabilitiesGetter according to specified interface name; - Parsing the capabilities cache file wrapped to the try/catch construction; - Add AddRequiredRequestsForCapabilities method; - Remove MatchesCCPUVersion method as redundant; - Rework PrepareXXXJsonValueForSaving methods; - Add new Unit tests for HMICapabilitiesImpl; - Update existing Unit tests according to the appropriate changes; * Update CCPU Version max value parameter (regular and external policies) * Minor updates: - Remove input parameter for the GetSystemInfo method, move the OnSoftwareVersionReceived method out of GetSystemInfo method; - UIGetCapabilitiesResponse: retrieve reference for a specific section from a message instead of using the whole path to needed section; - OnTTSLanguageChangeNotification: add saving cached capabilities for VR; - OnVRLanguageChangeNotification: update log info; - VRGetCapabilitiesResponse: retrieve reference for a specific section from a message instead of using the whole path to needed section; - VRGetSupportedLanguagesResponse: update log info; - CacheManager (regular and external policies): add doxygen description for the SetPreloadedPtFlag method; move back meta info out of "for" loop; * Minor changes for the Unit tests * Fix SDL Core crash during getting RC capability There the case when RC capability didn't initialized yet and rc_capability() method is calling and returns invalid pointer to the RC capability. This commit provides the next changes: - Add check for returned pointer to rc_capability; - Add the new one capabilitiesStatus parameter "kInvalidStatus" for return value for the GetModuleDataCapabilities method; - Update capabilitiesStatus parameter names according to the coding style; * fixup! Re-factor HMICapabilitiesImpl and add the new one method * fixup! Re-factor HMICapabilitiesImpl and add the new one method * fixup! Re-factor HMICapabilitiesImpl and add the new one method * Remove "system_display_capabilities" smart key * Add to the RequestToHMI the RequestCapabilities method The "RequestCapabilities" methos is common for the all *IsReady requests. Because of that it was moved to the base class with common logic. * Re-factor all *IsReady request. The logic for getting capabilities from HMI is common for the all *IsReady request. This logic is implemented in the base RequestToHMI class. So, this logic should be removed from each request and the method of the base class should be used. * fixup! Re-factor all *IsReady request. Co-authored-by: LitvinenkoIra <ilytvynenko@luxoft.com> Co-authored-by: Igor Gapchuk <igapchuck@luxoft.com> Co-authored-by: Yevhenii Dementieiev (GitHub) <ydementieiev@luxoft.com> Co-authored-by: sniukalov <sniukaov@luxoft.com>
| * Feature/aligning hmi mobile api for pcm stream capabilities (#3297)Igor Gapchuk (GitHub)2020-07-071-0/+5
| | | | | | | | | | | | | | | | | | * Adding pcmStreamCapabilities param to HMI API in UI.GetCapabilities * Adding to read pcmStreamCapabilities from HMI * Add unit test to cover a test case Co-authored-by: sniukalov <sniukaov@luxoft.com>
| * Fix 3119 bug:App gets REJECTED instead of UNSUPPORTED_RESOURCE to ↵Jim-Nexty2020-06-301-1/+1
| | | | | | | | | | ChangeRegistration with not supported language (#3427) Co-authored-by: zhangwenqin <zhangwenqin@iauto.com>
* | Fix styleJackLivio2020-07-146-28/+30
| |
* | Fix typo in RPC classJackLivio2020-07-131-1/+1
| |
* | Fix typoJackLivio2020-06-301-2/+2
| |
* | Add missing rpc implementation piecesJackLivio2020-06-302-0/+16
| |
* | Main menu updating and paginationJackLivio2020-06-304-0/+285
|/
* only set language in rai response if it is valid (#3435)Collin2020-06-151-4/+12
|
* Filter unknown enums when removing unknown parameters (#3385)Jacob Keeler2020-06-101-2/+2
| | | | | | | | | * Add enum filtering step to applySchema This step is triggered when `remove_unknown_parameters` is enabled * Add unit tests * Pass warning info to message response after processing
* Sdl must store onWayPointChange internally (#2490)Pavel Zhdanov (GitHub)2020-06-081-0/+1
| | | | | | | | | | | | * Add saving way points during notification - When OnWayPointNotification appeared the wayPoint is saving - When new app subscribing on wayPointNotification stored way points are sending to app * Add unit tests * fix style, update to remove (uint32_t) overload of SubscribeAppForWayPoints Co-authored-by: collin <collin+i@collinmcqueen.com>
* Fix onsystemrequest retry logic (#3400)JackLivio2020-05-282-3/+9
| | | | | | | | | * Fix onsystemrequest retry logic * Cache policy update file from HMI for retries * Fix issues with previous commit Co-authored-by: jacobkeeler <jacob.keeler@livioradio.com>
* Forward OnButtonPressNotifications where HMI specifies appID to apps in ↵Collin2020-05-201-3/+4
| | | | | | | | | LIMITED HMI Level (#3378) * initialize app in non custom button path of on_button_press run * fixup! initialize app in non custom button path of on_button_press run fix unit tests with changes in run
* Fix/gufm check syntax (#3369)Collin2020-05-201-1/+10
| | | | | | | | | | | * Fix implementation for SDLGetUserFriendlyMessage * Unit test for SDLGetUserFriendlyMessage: checking syntax * Changes according to comments * add invalid syntax error response info Co-authored-by: ZhdanovP <pzhdanov@luxoft.com>
* Fix/issue 1951 (#3371)Collin2020-05-182-6/+6
| | | | | | | | | | | | | | | * remove deadlock danger when removing Connections from a ConnectionMap * fix style, use log debug instead of trace for singular messages * Revert "fix style, use log debug instead of trace for singular messages" This reverts commit c83288ec9fc9007e48044b09ad038edbf612e038. * fix style, use log debug instead of trace for singular messages * restore condition updates lost with merge of old versions Co-authored-by: Frank <fronneburg@xevo.com>
* Merge pull request #2553 from smartdevicelink/fix/start_stream_retry_countJacob Keeler2020-05-182-8/+8
|\ | | | | Fix Start Stream retry count
| * Fix Start Stream retry countfix/start_stream_retry_countjacobkeeler2018-08-292-8/+8
| |
* | ResetGlobalProperties doesn't reset HELPPROMPT and VRHELPITEMS to default ↵Collin2020-05-181-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | values (#3357) * Fix bug `ResetGlobalProperties` (#2337) Fix bug `ResetGlobalProperties` does't reset `HELPPROMPT` and `VRHELPITEMS` to default values Fix UT's after bugfixing - Fix `ResetGlobalPropertiesRequestTest` - Add mock function into `MockApplicationManagerSettings` Github issue #1306 Co-authored-by: v-malko4 <vmalkov@luxoft.com> * fix vr_help_title SO type, rename help_prompt_ in unit tests to so_help_prompt * fix style Co-authored-by: v-malko4 <vmalkov@luxoft.com>
* | only return if we are sure we are out of space (#3361)Collin2020-05-131-5/+0
| |
* | Revert "RAI reply DUPLICATE_NAME when app has same id and name as existing app"collin2020-05-131-11/+6
| | | | | | | | This reverts commit 236bdbaa283147044a6144f8c96cc43b82ff1014.
* | RAI reply DUPLICATE_NAME when app has same id and name as existing appcollin2020-05-131-6/+11
| |
* | [SDL4.0]SDL does not create icons folder in case it was removed (#2649) (#3359)Collin2020-05-111-0/+8
| | | | | | | | | | | | | | | | The check for existence directory of app icons folder has been added to SetAppIconRequest. Co-authored-by: ValeriiMalkov <vmalkov@luxoft.com> Co-authored-by: ValeriiMalkov <vmalkov@luxoft.com>
* | Fix PROPRIETARY and HTTP retry sequences (#3329)Jacob Keeler2020-04-202-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | * Fix PROPRIETARY and HTTP retry sequences For PROPRIETARY policy updates, Core is responsible for the retry sequence and cycling through update URLs. This fixes the PROPRIETARY flow with a few specific changes: 1. Apps for PTU are chosen randomly using the existing process, but after an application is chosen, all URLs that are associated with that application will be attempted before moving onto the next application. 2. When an OnSystemRequest(PROPRIETARY) is received from the HMI, Core will ignore the `appID` and `url` properties and populate them itself. This is because Core is responsible for providing these fields in PROPRIETARY mode. * Add caching for PTU URLs if provided by HMI * Fix bug in HTTP mode
* | fix APTDisplayText covert bug (#3291)Jim-Nexty2020-04-071-4/+6
| | | | | | Co-authored-by: xiatian <xiatian@iauto.com>
* | Fix OnSystemRequest(LOCK_SCREEN_ICON_URL) sending (#3271) (#3289)Collin2020-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was noticed an issue that sometimes Policy Manager component is returning an empty url for lock screen icon. The root cause of that is the data races between thread which is sending OnSystemRequest notification and backupper thread which overwrites data in the database. As these two threads may have an intersection, there could be a possible situation that backuper thread erased data from `endpoints` table and another thread is using SQL query to select the data from the same table. As a result, second thread receives an empty result as the data was erased and the new one was not inserted yet by backupper thread. After that, SDL just does not send OnSystemRequest as the URL is empty. To fix that issue, policy component has been updated to use internal policy cache instead of direct access to policy database each time to get URL. This will guarantee that a sending thread will get an up-to-date infromation required for OnSystemRequest notification. Also, code cleanup has been done in order to remove all functions which become unused after this fix. Co-authored-by: Andrii Kalinich (GitHub) <AKalinich@luxoft.com>
* | Feature/Web Engine support (#3221)Alexander Kutsan (GitHub)2020-02-278-24/+494
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ini file parameters for WebEngineSupport Issue : #3197 * Add Server WebSocket transport * Policy changes for Web Engine support Issue : #3197 * Changes in HMI_API for WebEngineSupport Issue : #3197 * Add application manager implementation for WebEngineSupport Add appropriate commands Make changes in application manager Issue : #3197 * Bug fix : Do not override message params if request setups it * Update SDD * fixup! Add application manager implementation for WebEngineSupport * fixup! Add Server WebSocket transport * Rename websocket dir to websocket_server * Rename WebSocketTransport adapter to WebSocketServerTransportAdapter * fixup! Update SDD * Fix/update app list after unregistration (#3252) * fixup! Rename WebSocketTransport adapter to WebSocketServerTransportAdapter * fixup! Rename websocket dir to websocket_server * Don't remove enabled WebEngine apps from pending apps * Rework WebEngine device ID generation * Fix build after back merge * Fix get app properties (#3258) Co-authored-by: Maksym Ked (GitHub) <41471947+mked-luxoft@users.noreply.github.com> * Remove unused vin_code variable Co-authored-by: Maksym Ked (GitHub) <41471947+mked-luxoft@users.noreply.github.com> Co-authored-by: Andriy Byzhynar (GitHub) <AByzhynar@luxoft.com> Co-authored-by: Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> Co-authored-by: Andrii Kalinich (GitHub) <AKalinich@luxoft.com>
* | don't send onSystemRequest LOCK_SCREEN_ICON_URL to mobile if url is missing ↵Collin2020-02-261-6/+9
| | | | | | | | (#3257)
* | Fix LastState methods thread safe access (#2626)Ira Lytvynenko (GitHub)2020-02-141-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | Feature/HMI Policy Table Update using vehicle modem (#3201)Ira Lytvynenko (GitHub)2020-02-052-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Send UPDATING state after receiving a successful SDL.PolicyUpdate response * Restart the timeout in case SDL received BC.OnSystemRequest with type PROPRIETARY or HTTP from HMI in UPDATING state * Fix UPDATE_NEEDED - UPDATING sequence in case of second app register * Add unit tests * fixup! Send UPDATING state after receiving a successful SDL.PolicyUpdate response * fixup! Restart the timeout in case SDL received BC.OnSystemRequest with type PROPRIETARY or HTTP from HMI in UPDATING state Co-authored-by: Yaroslav Mamykin (GitHub) <33784535+YarikMamykin@users.noreply.github.com>
* | Fix processing of VR only Perform Interaction response (#3122)Yaroslav Mamykin (GitHub)2020-01-311-20/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix processing of VR only PI response 1. Added sending of UI_ClosePopUp request to HMI after VR.PerformInteraction response. 2. Added sending response with choice_id to mobile in case of successful VR.PerformInteraction response * Fix adapt existing unit tests * Add new unit tests * fixup! Fix processing of VR only PI response * fixup! Fix processing of VR only PI response * fixup! Add new unit tests * fixup! Fix processing of VR only PI response * fixup! Add new unit tests
* | Update jsoncpp library (#3155)Yevhenii Dementieiev (GitHub)2020-01-292-6/+11
| | | | | | | | | | | | | | | | * Delete old version of jsoncpp lib and add new like submodule, change deprecated interface for new. * Logs output without extra special symbols * fixup! Delete old version of jsoncpp lib and add new like submodule, change deprecated interface for new.
* | SDL restores AddCommands in the order they were created (#2515)Anna Pipko (GitHub)2020-01-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * SDL restores AddCommands in the order they were created SDL generates and assigns internal_id for each AddCommand from mobile app and restore AddCommands by this internal_id * Fix message helper unit tests * Fix resume controller unit tests * Fix cmd_id in SendAddVRCommandToHMI * fixup! SDL restores AddCommands in the order they were created * Go to the next command if command id missing Co-authored-by: Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> Co-authored-by: Yevhenii Dementieiev (GitHub) <57259850+ydementieiev@users.noreply.github.com>
* | Handle wrong message type from HMI was added (#2394)Pavel Zhdanov (GitHub)2020-01-211-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle wrong message type from HMI was added * Fixed ignored request from HMI in case of invalid data. utils::SharedPtr replaced with std::shared_ptr for ProcessMessageFromHMI and ProcessMessageFromMobile in rpc_handler. New parameter "report" in HandleWrongMessageType in order to get a proper error message in response. Redundant log message removed from sdl_activate_app_request. INVALID_DATA now will be sent as a response to HMI in case of wrong parameters in the request. Co-authored-by: Mykola Korniichuk (GitHub) <42380041+mkorniichuk@users.noreply.github.com>
* | Fix SDL app stream processing with non-streamable state. (#3151)Mykola Korniichuk (GitHub)2020-01-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix SDL app stream processing with non-streamable state. For determining whether an application is allowed to stream, SDL considered only HMI_Level. Now streaming state is also taken into account. Fix notifications for not streamable apps * Fix unit tests after rename function in new inplimentation * Minor fixes * const parameter for StartEndStreamTimer * Fix logging messages * end_stream_timer shanged to SingleShot * fix unit test for state_controller * fixup! Minor fixes * const parameter for StartEndStreamTimer * Fix logging messages * end_stream_timer shanged to SingleShot * fix unit test for state_controller * rename HMILevelAllowsStreaming -> HMIStateAllowsStreaming * fixup! Fix SDL app stream processing with non-streamable state. Co-authored-by: Yevhenii Dementieiev (GitHub) <57259850+ydementieiev@users.noreply.github.com>
* | Merge pull request #3145 from smartdevicelink/fix/SDL_crash_during_SetAppIconremote_atf_testingJacob Keeler2020-01-161-28/+26
|\ \ | | | | | | Fix/sdl crash during set app icon