summaryrefslogtreecommitdiff
path: root/src/components/application_manager
Commit message (Collapse)AuthorAgeFilesLines
* ensure apps receive default HMI status before activated status (#3559)7.0.0-RC2release/7.0.0Collin2020-10-298-15/+242
| | | | | | | | | | | | | | | | | | | | * remove cloud app exception from StateControllerImpl::OnApplicationRegistered * Fix/ Postpone application activation if registration is not complete yet (#3557) * Postpone application activation if registration is not complete yet * fixup! Postpone application activation if registration is not complete yet * fixup! Postpone application activation if registration is not complete yet Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com> * fix style * fix unit tests Co-authored-by: Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com>
* remove possibility for invalid choice ID to be sent to mobile (#3555)Collin2020-10-291-10/+15
|
* Fix a/v streaming retry sequence issues (#3552)Andrii Kalinich (GitHub)2020-10-264-60/+70
| | | | | | | | | | | | | | | | | | There were noticed two issues related to a/v streaming: 1. Due to object self destruction after TerminateRequest() call any attempt to access member field of that object may cause an undefined behavior - it might be a core crash or corrupted value sometimes. In this particular case, SDL tries to access `message_` field through `application_id()` function after object destruction. As a result, sometimes SDL crashes and sometimes this function just returns 0. Because of that, SDL was not able to find application by zero id and broke the retry sequence. This causes random failures of some ATF scripts. To avoid that issue, all retry logic was extracted into the separate function and `TerminateRequest` was moved after that function. This will guarantee that there is no attempts to access object fields after its destruction. 2. There was noticed that SDL makes one redundant retry attempt. That was because of late retry value increment. To fix that issue, increment has been placed before retry amount check.
* Bugfix 2808 copy (#3546)JackLivio2020-10-262-0/+22
| | | | | | | | | | | | | | | * fix issue 2808:SDL Crash seen in SDL upon receiving rpc - OnEmergencyEvent with enabled:true * change code stype * Fix conflicts * Fix log * Fix crash * Address comments Co-authored-by: zhangwenqin <zhangwenqin@iauto.com>
* Fix sdl sends unexpected disconnect with resource constraint (#3516)Serhii Niukalov (GitHub)2020-10-234-7/+51
| | | | | | | | | | | | * Rework processing of the OnExitApplication (RESOURCE_CONSTRAINT) notification * Update UTs according to changes Co-authored-by: sniukalov <sniukaov@luxoft.com> Co-authored-by: Aleksandr Kutsan <AKutsan@luxoft.com> Co-authored-by: jacobkeeler <jacob.keeler@livioradio.com> Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com>
* Fix formatting for logs after logger overhaul (#3554)Jacob Keeler2020-10-234-25/+16
| | | | | * Fix formatting for logs after logger overhaul Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
* Add missed NACK reasons (#3545)Yana Chernysheva (GitHub)2020-10-235-152/+129
| | | * Add missed NACK reasons, update UTs and add minor changes
* Fix application activation after resumption (#3550)Yana Chernysheva (GitHub)2020-10-225-28/+18
| | | | | * Set is_resuming flag to false * Change return value in RestoreAppHMIState and StartAppHmiStateResumption
* Add defvalue to policy table schema (#3530)Jacob Keeler2020-10-222-8/+23
| | | * Add defvalue to policy table schema
* Keep FULL for apps after conflict resolution (#3538)Andrii Kalinich (GitHub)2020-10-201-1/+5
|
* Add check for non-existent parent ID to AddSubMenuRequest (#3534)Yana Chernysheva (GitHub)2020-10-202-3/+38
| | | | | * Add check for non-existent parent ID to AddSubMenuRequest * fixup! Add check for non-existent parent ID to AddSubMenuRequest
* Fix synchronization in WaypointsPendingResumptionHandler (#3531)Yana Chernysheva (GitHub)2020-10-193-137/+138
| | | | | | | | | There was a problem with duplicate subscriptions to shared data due to time gap between check for already subscribed apps in SDLRPCPlugin and further processing of corresponding requests in WayPointsPendingResumptionHandler. That's why this check was moved to WayPointsPendingResumptionHandler. Also refactoring of some methods WayPointsPendingResumptionHandler class was done to make their logic clearer and easier to understand.
* Add error handling for failed hmi message send (#3537)JackLivio2020-10-141-0/+20
|
* remove unlock of lock that isn't locked (#3536)7.0.0-RC1Collin2020-10-081-1/+0
|
* Fix/usb handler thread safe stop (#3492)Andrii Kalinich (GitHub)2020-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wait for UsbHandler thread end in UsbHandler dtor The Thread dedicated for handling libusb events should exit successfully on it's own. This guarantees that `libusb_close()` being called on all devices, as well as `libusb_exit()` call is properly sequenced. Thread exits in recommended by libusb doc way: 1. set exit flag 2. deregister hotplug callbacks, which will wake up `libusb_handle_events()` once again. But this commit changes the way the Thread being joined. It ensures that `join()` is called with `kNoStop` flag, which prevents force stop using `pthread_cancel()`. * Using atomic bool for shutdown_requested_ flag Making UsbHandler::shutdown_requested_ flag atomic to guarantee mutual access to it. exchange() call is needed for helgrind to feel sure that there is no data race. * Remove redundant DCHECK This assertion has been exposed by the current fix
* Re-order rai logic for plugins (#3526)JackLivio2020-10-063-8/+18
| | | | | | | | | | | * Re-order rai logic for plugins * style * Add mock method * Add method descriptions * Add timing content
* Bugfix 3173 (#3528)JackLivio2020-10-064-1/+54
| | | | | | | | | | | * Fix 3173 bug:multi-thread access one pointer at same time caused a wild pointer problem in HMICapabilitiesImpl class * modify test code for 3173 * fix Unit tests * Fix merge conflicts Co-authored-by: zhangwenqin <zhangwenqin@iauto.com>
* Add check for already processed resumptions (#3525)Yana Chernysheva (GitHub)2020-10-053-142/+61
|
* Fix streamer activity in case of suspend (#3488)Andrii Kalinich (GitHub)2020-10-057-43/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix streamer activity in case of suspend The problem of the current implementation is that SDL kills streaming thread responsible for sending a/v streaming data to HMI when streaming timeout expires. This issue is observed when mobile app dumps 10-seconds audio file to SDL during 2 seconds and after that app does not send any data. In that case HMI will play audio file during 2 seconds + timeout = 5 seconds. At the 5th second SDL just kills streaming thread with all pending messages, however audio service is still open. As a result not a whole audio file is played. The correct behavior from SDL side in that case is not kill streaming thread when streaming timeout was expired. SDL should kill streaming thread only when service is actually stopped. Current SDL behavior was updated to align with a correct behavior described above. * Adjust fix to work with audio socket streaming * Revert "[WIP] initial fix of socket streaming by guessing playback time (#3057)" This reverts commit 7c442abce73c462e7724a64b3ce037bcb8e9093e. * Remove unused code after revert * Fix style issues
* Fix deadlock in policy handler (#3497)Igor Gapchuk (GitHub)2020-10-053-356/+460
|
* Fix GetInteriorVehicle request wrong processes result codes from HMI (#3519)Igor Gapchuk (GitHub)2020-10-022-6/+68
| | | | GetInteriorVehicle request RPC should process the next result codes as success: WRONG_LANGUAGE, RETRY, SAVED.
* Delete module_types_str_mappingYana Chernysheva2020-10-021-9/+1
|
* Merge branch 'release/7.0.0' into ↵Yana Chernysheva2020-10-0271-896/+589
|\ | | | | | | fix/move_duplicate_conversion_functions_to_message_helper
| * Remove ManageMobileCommand call from UnregisterAppInterfaceRequest and ↵Yana Chernysheva (GitHub)2020-10-012-16/+0
| | | | | | | | corresponding unit test (#3389)
| * Merge pull request #3523 from smartdevicelink/fix/play_tone_without_ttsJacob Keeler2020-10-011-3/+4
| |\ | | | | | | Ignore playTone if provided without TTSChunks
| | * Ignore playTone if provided without TTSChunksfix/play_tone_without_ttsjacobkeeler2020-09-301-3/+4
| | |
| * | Fix Cppcheck issues (#3453)Yana Chernysheva (GitHub)2020-10-0153-325/+275
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix noExplicitConstructor issue * Fix functionConst issues * Fix unusedFunction and unusedField issues * Fix redundantInitialization * Fix unreadVariable and unusedVariable issues * Fix postfixOperator issue * Fix variableScope issue * Fix invalidPrintfArgType_sint and unsignedLessThanZero issues * Fix other errors * Add changes, related to functions marked as unused * Fix new issues * Fixe review comment * Fix codestyle * Fix constParameter errors * Fix functionConst errors * Fix noExplicitConstructor, redundantInitialization errors * Fix unreadVariable errors * Fix shadowVariable error * Fix useStlAlgorithm errors * Fixe variableScope error, add FIXME comment * Fix code style * Fix compile error * Remove unsued function * Fix compile error Co-authored-by: Vladislav Semenyuk <vsemenyuk@luxoft.com>
| * Use atomic bool in ApplicatinManager (#3491)Andrii Kalinich (GitHub)2020-09-302-10/+5
| | | | | | | | | | Replace bool flag 'is_stopping_' in class ApplicationManagerImpl and remove mutex 'stopping_application_mng_lock_'.
| * Replace direct access with accessor for apps (#3487)Andrii Kalinich (GitHub)2020-09-302-18/+22
| | | | | | | | | | | | | | | | | | There was found a few places inside of ApplicationManager where `applications_` and `apps_to_register_` members were used without locks however these members are commonly used and must be synchronized in all places. To avoid potential data races, direct usage of these elements were replaced with accessor for read-only operations. Also was added a missing lock.
| * Merge branch 'develop' into release/7.0.0collin2020-09-302-0/+2
| |\
| | * Unsubscribe from event in VehicleInfoPendingResumptionHandler (#3515)Yana Chernysheva (GitHub)2020-09-302-0/+2
| | |
| * | Merge pull request #3510 from ↵Jacob Keeler2020-09-292-476/+63
| |\ \ | | | | | | | | | | | | | | | | LuxoftSDL/fix/fix_enums_conversion_in_hmi_capabilities Fix/fix enums conversion in hmi capabilities
| | * | Align HMI capabilities file with APIAndrii Kalinich2020-09-231-1/+1
| | | |
| | * | Fix enum conversion in HMI capabilitiesAndrii Kalinich2020-09-221-475/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were found a couple of hardcoded HMI capabity enum to string values and some of them were outdated. This legacy code can be easily replaced with the templated function supplied from generated API. By that reason, all hardcoded pairs and maps were removed and replaced with a common function.
| * | | Add additional check to avoid duplicate subscriptions to Vehicle Data (#3512)Yana Chernysheva (GitHub)2020-09-294-28/+94
| | |/ | |/| | | | | | | | | | | | | | | | * Replace check for already existed subscriptions * Delete unused enum * Update unit tests and add new unit test
| * | Add check whether restoring of all required data was completed (#3508)Yana Chernysheva (GitHub)2020-09-221-2/+4
| | |
| * | Merge pull request #3507 from smartdevicelink/fix/coverity_7.0Jacob Keeler2020-09-212-2/+7
| |\ \ | | |/ | |/| Add fixes for new Coverity issues
| | * Add fixes for new Coverity issuesfix/coverity_7.0jacobkeeler2020-09-172-2/+7
| | | | | | | | | | | | Fixes CID 214309, 214305, 214304
| * | Fix/Delay OnHMIStatus until RAI response is sent (#3506)Shobhit Adlakha2020-09-2110-16/+113
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add is_ready flag to apps and handle sending OnHMIStatus after RAI response * Add mock functions * Address review comments * Only send delayed onHMIStatus if RAI was a success * Prevent secondary hmi level none to cloud apps * Move enabled check to last when init new cloud app Co-authored-by: JackLivio <jack@livio.io>
* | Fix issue with bracesYana Chernysheva2020-09-101-2/+1
| |
* | Delete unused fileYana Chernysheva2020-09-101-731/+0
| |
* | Merge branch 'develop' into ↵Yana Chernysheva2020-09-10627-7883/+16146
|\ \ | |/ | | | | fix/move_duplicate_conversion_functions_to_message_helper
| * Validate the data before dereferencing it (#3493)Ira Lytvynenko (GitHub)2020-09-081-2/+7
| |
| * [SDL-0188] Interior Vehicle Data Resumption (#3480)Ira Lytvynenko (GitHub)2020-09-0438-93/+1826
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add changes related to AppExtension and RCAppExtension * Change OnTimeOut() method in affected requests * Add changes related to ApplicationHelper class * Add changes related to EventDispatcher * Fill subscription data for all pending requests Changed SDL logic to update subscription results for each pending subscription request before notifying resumption processor about current subscription is processed. This should be done beforehand because after raising event to processor it can finish resumption process and if it has failed then it can trigger sending of the next subscription request. So at that point, each subscription request should contain updated subscriptions status, otherwise some redundant requests might be sent. * Add RC data to resumption data processor * Add RCPendingResumptionHandler class * Process timeout for get interior vehicle data * Revert Interior vehicle data * Add resumption logic to RC app extension * Resumption logic in RC plugin * Helpers RC functions * Update hash for RC data * Filter RC subscriptions in vehicle data plugin * UTs for the RCPendingResumptionHandler Co-authored-by: Yana Chernysheva <ychernysheva@luxoft.com> Co-authored-by: Andrii Kalinich (GitHub) <AKalinich@luxoft.com> Co-authored-by: Aleksandr Kutsan <AKutsan@luxoft.com> Co-authored-by: Igor Gapchuk <igapchuck@luxoft.com> Co-authored-by: sniukalov <sniukaov@luxoft.com> Co-authored-by: Dmitriy Boltovskiy <dboltovskyi@luxoft.com>
| * [SDL-0190] Handle response from HMI during resumption data (#3475)Yana Chernysheva (GitHub)2020-09-0498-1860/+6182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add changes to RAI request * Add new class ResumptionDataProcessor * Add new class SDLAppExtension * Add new class ExtensionPendingResumptionHandler * Add new class SDLPendingResumptionHandler * New class VehicleInfoPendingResumptionHandler * Add changes related to ApplicationManager class * Add changes related to MessageHelper class * Add changes related to StateController class * Add changes related to ResumeController class * Add changes related to PolicyHandler class * Add changes related to SDLRPCPlugin * Add changes related to VehicleInfoPlugin * Add changes related to AppServiceAppExtension and SystemCapabilitiesAppExtension * Add changes related to ResetGlobalProperties request * Add changes related to VehicleInfoAppExtension * Add changes related to AppExtension and RCAppExtension * Change OnTimeOut() method in affected requests * Add changes related to method IsAppSubscribedForWayPoints * Fix problem with multiple definitions during building of unit tests * Add changes related to ApplicationHelper class * Add changes related to EventDispatcher * Add changes related to OnSystemCapabilitiesUpdated notification * Fix/fix rai default timeout (#108) Fix RAI default timeout As RAI request does not depend on any HMI response there is no need to track any timeout for it. RAI request will be removed from/ RequestController queue upon RAI response which will be sent anyway Update UT * Do not unsubscribe from pending VD Update SDL logic to avoid sending of unsubscribeVD to HMI during vehicle data resumption for case when another application is also have pending subscription for the same vehicle data. * Fill subscription data for all pending requests Changed SDL logic to update subscription results for each pending subscription request before notifying resumption processor about current subscription is processed. This should be done beforehand because after raising event to processor it can finish resumption process and if it has failed then it can trigger sending of the next subscription request. So at that point, each subscription request should contain updated subscriptions status, otherwise some redundant requests might be sent. * fixup! Add new class ResumptionDataProcessor * fixup! Add new class SDLPendingResumptionHandler * fixup! Add new class ExtensionPendingResumptionHandler * fixup! New class VehicleInfoPendingResumptionHandler * fixup! Add changes to RAI request * fixup! Add new class ResumptionDataProcessor * fixup! Add new class SDLAppExtension * fixup! Add new class SDLPendingResumptionHandler * fixup! New class VehicleInfoPendingResumptionHandler * fixup! Add changes related to ApplicationManager class * fixup! Add changes related to MessageHelper class * fixup! Add changes related to ResumeController class * fixup! Add changes related to SDLRPCPlugin * fixup! Add changes related to AppExtension and RCAppExtension * fixup! Add changes related to AppServiceAppExtension and SystemCapabilitiesAppExtension * fixup! Add changes related to OnSystemCapabilitiesUpdated notification * fixup! Add changes related to ResumeController class * fixup! Change OnTimeOut() method in affected requests * fixup! fixup! Add new class SDLAppExtension * Filter RC subscriptions in vehicle data plugin * Timeout process for reset global properties * Use ResumptionDataProcessor interface instead of subscriber function * Rename ExtensionPendingResumptionHandler * Rename SDLAppExtension * Revert "Filter RC subscriptions in vehicle data plugin" This reverts commit f35e573e7587b06472e9f396d249339e8fc05cc8. * Rename resumption_data_processor.cc * Rename SDLPendingResumptionHandler * fixup! fixup! Add changes related to OnSystemCapabilitiesUpdated notification * fixup! fixup! Add changes related to AppServiceAppExtension and SystemCapabilitiesAppExtension * fixup! Use ResumptionDataProcessor interface instead of subscriber function Co-authored-by: Andrii Kalinich (GitHub) <AKalinich@luxoft.com> Co-authored-by: Aleksandr Kutsan <AKutsan@luxoft.com>
| * Overhaul state manager to handle regular state changes during hmi events (#3476)Jacob Keeler2020-09-048-248/+613
| | | | | | | | | | * Overhaul state manager to handle regular state changes during hmi events * Add parent check for all calls
| * 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-0220-190/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * App not Un-Registering when trying to Force Close Nav App (#3374)Alexander Kutsan (GitHub)2020-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * SYNC-62924: App not Un-Registering when trying to Force Close Nav App SYNC-62924 1. video_streaming_Lock acquired was not released when timeout and stop called from another thread happens at the same time 2. resumption timeout callback was waiting on Policy_Manager_lock_ which was not released, when acquired if resuming application is activated. 3. Crash observered when one thread accessing multiframe data and other thread deleting the mutliframe data due to disconnection Co-authored-by: asanka17 <asanka17@ford.com> Co-authored-by: YarikMamykin <ymamykin@luxoft.com> Co-authored-by: LitvinenkoIra <ilytvynenko@luxoft.com>
| * [SDL 0046] Implement logger abstraction (#3472)VladSemenyuk2020-09-01525-5445/+5461
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>