aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-07-29homescreen/hs-proxy: Guard against empty appidsneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin_12.92.0marlin_12.91.0marlin_12.90.1marlin/12.93.0marlin/12.92.0marlin/12.91.0marlin/12.90.113.93.012.93.012.92.012.91.012.90.1Marius Vlad2-7/+15
Bug-AGL: SPEC-4037 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I6a9b7fd74d81cb117afcb12639862288769b7fde
2021-05-11clientmanager: Do not check for running applicationsmarlin_12.90.0marlin/12.90.0lamprey_11.92.0lamprey/11.92.012.90.011.92.0Marius Vlad1-32/+21
Due to some unforeseen consequences we can't really check for running applications, in an attempt to start them if they died/or have killed (either legitimate or not). To avoid deadlocking just have another pass over the clients and document the fact that requires a bit more digging to fix up correctly. Bug-AGL: SPEC-3902 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Suggested-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I97776938e2d0971eba509c1ea36462899d053a24
2021-03-10src/homescreen, hs-client, hs-proxy: Fix trivial unused warningslamprey_11.91.0lamprey/11.91.011.91.0Marius Vlad3-0/+4
As we're now using Werror, need clean-up some trivial bits. Bug-AGL: SPEC-3843 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I17c7e61c0fd3b420a4c76fa40fe6486d2bad0c5e
2021-03-10hs-clientmanager: Pass arguments to printf() wrappersMarius Vlad2-5/+5
Avoid crashing on various platforms, by not setting any argument at all. Bug-AGL: SPEC-3843 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ifb082b95fd6ebc71e863b843c9fd895f5f7efdde
2021-03-03hs-proxy,hs-clientmanager: Handle correctly the shutdown of appsMarius Vlad3-2/+76
The fake subscribe mechanism failed to account for the client context, which is bound to the afb_req_t of the client itself, and only dealing with the client list. This effectively means we can't really register (a/an automated) callback function to remove the appid from the client list once the application has been legally terminated/stopped. This adds a check to verify, for the showWindow verb, if the application is still found to be running, and return the appropriate value in case that is not case. This should determine to start the application and fix the issue. Bug-AGL: SPEC-3796 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia828e1ec374bf3bed21c52814721074c01f16691
2021-03-03hs-clientmanager: Do not store always the client contextMarius Vlad1-1/+2
This incorrectly assumed that by re-using the same client context we could gain access to the *current* client's context. But as we have seen, the fake subscribe mechanism isn't really capable of doing that, requiring a direct connection from the client to have that in. Storing the client context make sense to happen only when we can create it (with a real subscribe verb) and not *re-use* it, and assign it to other applications. This basically reverts it to the way it was previously. Bug-AGL: SPEC-3796 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I643dfe91049efa8937c9a8a21eb6fbb366b3fdcc
2021-03-03hs-proxy: Avoid creating a client contextMarius Vlad1-8/+1
The subscribe mechanism requires that the client itself performs the subscribe (it assumes a unique, distinct afb_req_t type in order to create the client context) and attempting to handle one, automatically would not really work, so only use it (the fake sub mechanism) the keep track of application w/ the help of the client_list. Bug-AGL: SPEC-3796 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I783614e1db83280878b77b786e4f80fccd1a74a1
2021-02-01Fix potential memory leakLi Xiaoming2-8/+7
json structure allocating code should be placed in where it is used, if there is a condition check which may cause a return before the before-mentioned place in the function. Bug-AGL: SPEC-3584 Change-Id: I5f88c7ce0b9257b2782144548f11a0e1d7ab388a Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
2020-11-05Fix pushAppListChangedEvent json-c object reference count errorkoi_10.93.0koi_10.92.0koi_10.91.0koi/10.93.0koi/10.92.0koi/10.91.010.93.010.92.010.91.0Yevgeny Hong1-2/+2
The agl-service-homescreen has been shut down due to an error in this part when installing or uninstalling the application. Bug-AGL: SPEC-3679 Signed-off-by: Yevgeny Hong <yev@drimaes.com> Change-Id: I276d57ade7db96dd2a3aaa59d54a1d259c17bef7
2020-08-19hs-proxy: Keep track of clientCtx and client when starting applicationjellyfish_9.99.4jellyfish/9.99.49.99.4Marius Vlad2-3/+60
The subscribe verb was used in the past to keep track of applications, which was done in background with the help of event handlers. As that no longer happens we keep track of the client and its clientCtx when starting directly from the homescreen binding, faking the subscribe logic. As the afb_req_t object is no longer in scope when the async callback handler returns, we do it before doing the call to af-main, and assume that we'll succeed. We use the async callback handler to verify if the application was indeed started but any application crashing afterwards will require an additional check performed, as it will found in the hash table of clients. Bug-AGL: SPEC-3524 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I0e417dc5f2953947cd27ca551c0d2a2af5c57e6d
2020-08-19hs-clientmanager: Store the appidClientContext directlyMarius Vlad2-2/+3
Make client related methods public to be able to call them from other callsites. Bug-AGL: SPEC-3524 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I7e13b83564bb6e5d49b760c27665b44d09b0ee94
2020-08-19hs-proxy: Hand over the hs_instance to AfmMainProxyMarius Vlad3-6/+7
Bug-AGL: SPEC-3524 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I80a7bac4244e62f49ab4bf068476ad4e888085f1
2020-08-19src: Split hs_instance into its own header fileMarius Vlad2-19/+26
We need to gain a hold of the clientManager class instance, which this hs_instance acts as a container. Bug-AGL: SPEC-3524 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I3ff67fee1a652e8e85857a32352593ac9a2dcca2
2020-05-26Fix CMake files and non-debug crashesScott Murray4-60/+31
Changes include: - Reworked src/CMakeLists.txt to use app template macros. - Removed now unnecessary linker script, symbol exports are handled in the app template macros. - Set missing required entries in conf.d/cmake/config.cmake, and update to match latest template version in cmake-apps-module, as well as some naming fixes in the PROJECT* definitions. - Move project definition to top-level CMakeLists.txt to make tracking conf.d/cmake/config.cmake changes easier. This quiets the warning from newer versions of CMake about needing a project definition in the top-level CMakeLists.txt. - Moved icon file to default location for app template. - Added config.xml.in file to work with app template, replacing previous hard-coded version. - Fixed some issues in src/hs-clientmanager.{h,cpp} to address crashes seen in the release widget now that it is actually built without debug flags, and to quiet some warnings. Bug-AGL: SPEC-3343 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I3741e6a307297272d5c22e894dfa9ff8b0dd1f52
2020-01-24Relax computation of appidicefish_8.99.5icefish/8.99.58.99.5José Bollo1-6/+1
The returned appid is now either the part up to the first @ or the entire string if no @ is present. This evolution is needed to able the removal of handling different versions. Bug-AGL: SPEC-2538 Change-Id: Ibe8cfbb60333702ba33d59d3e89f33688d2a0f51 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-03-28Impove event processwang_zhiqiang4-20/+129
1. manager event list in hs_instance. 2. add setEventHook interface to hook event. Change-Id: I65a64f2d16343eb68d22fd1ad9d5fbf565f5967a Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2019-03-28Change log macro to AFB_XXXwang_zhiqiang6-168/+68
1. using binder log macro instead of HMI_LOG. 2. unify log using level as below: AFB_ERROR: fatal error or serious error may occur. AFB_WARNING: input parameter error or not serious error. AFB_NOTICE: alert sth. AFB_INFO: print input argument or sth else. AFB_DEBUG: prompt for calling location. 3. delete hmi-debug.h. Change-Id: I203864ced39c418d2f792faa50ab2c009deb9d02 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2019-03-25Start app and get runnables list by homescreenwang_zhiqiang12-17/+924
1.start application in showWindow. 2.add "getRunnables" verb. 3.handle "application-list-changed" event from afm-main and add "application-list-changed" event. Bug-AGL: SPEC-2188 Change-Id: I619b97424d20af373a945ff502a8133339916923 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2019-03-14Define func_list as staticwang_zhiqiang2-12/+16
For sharing func_list between all client instance, define func_list as static. Change-Id: I8a0a131128e057cc55a2d3efb76b66033dd20a04 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2019-01-16Improve homescreen-servicewang_zhiqiang5-519/+356
1.Improve class cohesion and reduce public interface number 2.Unified event pattern BUG-AGL: SPEC-2120 Change-Id: I4c5066be2deaf2b809af66cb5a8acdc5bffa5a23 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-11-28fix issue,not free stringguppy_6.99.2guppy/6.99.26.99.2wang_zhiqiang4-18/+74
After called afb_req_get_application_id api needed to free the string. Change-Id: Ia59a3f4984854d61f4c5a8d9206f44988594ebf3 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-11-23change project namewang_zhiqiang1-1/+1
change homescreen-service-2017 to homescreen-service. Change-Id: I440864ec5dc940bbbaf34aa09c6c1da4b8b9be57 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-11-23Improvement:a client instance only call afb_req_subscribe oncewang_zhiqiang2-0/+6
when call subscribe every time, hs_client instance will call afb_req_subscribe once, this is needless, every hs_client always only has one event, so only need to call afb_req_subscribe once. Change-Id: I91417b749201fc378287e03f08dfd4dfd5df9dc7 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-11-14add new features in homescreen-service and homescreenwang_zhiqiang7-0/+489
homescreen-service: add five verbs. 1.showWindow: instead of tap_shortcut and show onscreen. 2.hideWindow: used when want to hide onscreen. 3.replyShowWindow: used when post onscreen reply information to application. 4.showNotification: used by application who want to display notification on homescreen top area. 5.showInformation: used by application who want to display information on homescreen botton area. homescreen: 1.add fullscreen transfer button. 2.display notification and information. Bug-AGL: SPEC-1931 Change-Id: I612e541243ee6502eb90ff1aa2ab4d99bfbc7156 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-11-06use appid instead of appname in "tap_shortcut"wang_zhiqiang5-16/+11
Now In homescreen-service used application_id to identify different application, so use appid instead of appname in "tap_shortcut" parameter. Bug-AGL: SPEC-1764 Change-Id: I8493331f37977a30d6d88c0d222da4c2db32e727 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-10-30Improve HS_ClientManager and fix issuewang_zhiqiang5-160/+206
1.No longer operate HS_Client in homescreen.cpp,move to HS_ClientManager class. 2.In hs_client.cpp,afb_event_push return the count of clients that received the event, not push event result, in tap_shortcut/on_screen_message/on_screen_reply directly return zero. Bug-AGL: SPEC-1764 Change-Id: Ief17d3fe3a9c80937fbda05d1c158eeed3924a75 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-10-23Migration to binding V3wang_zhiqiang7-46/+47
migration homescreen-service from v2 to v3 Change-Id: I5e6d42c3dff528e46d0ca407e09eb1d05bacea80 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-10-17emit event to one applicationwang_zhiqiang7-51/+572
changed agl-service-homescreen and libhomescreen to make agl-service-homescreen emit event to one application only. BUG-AGL: SPEC-1764 Change-Id: I87e4fc8fe900fdf9d7fde04852077c7174b8a3ba Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-09-19Init afb_daemon event with loopwang_zhiqiang1-31/+13
use loop to make afb_daemon event automatically. Change-Id: I599d333fea7feb18db91ed3bbe43faad405c41c1 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-09-11Add some comments for hs-helperguppy_6.90.0guppy/6.90.06.90.0zheng_wenlong2-12/+120
Add some comments. Change-Id: I08e4f2050f5107d538a4622dc5462d11bbd5078d Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2018-09-03Update lastest code from agl-service-homescreen-2017flounder_5.99.6flounder/5.99.65.99.6zheng_wenlong5-34/+33
Update the lastest code from agl-service-homescreen-2017. To impove homescreen-service's extensibility. "Change homescreen-service from c project to c++ project" Relative Commit: https://gerrit.automotivelinux.org/gerrit/#/c/16351/ Change-Id: Id7e50fa61fdfcff30f69588aa1da4d93695edfc1 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com> Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
2018-08-24Revert "Use appid between homescreen-service and apps"flounder_5.99.4flounder/5.99.45.99.4Tadao Tanikawa1-4/+4
This reverts commit b5702d25b7b5386fabd6a81a748ea2d6fe647fcd. Bug-AGL: SPEC-1685 Change-Id: If5b526a5a5406ff0c3e59cc4a578b977386bda14 Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
2018-08-06Use appid between homescreen-service and appsflounder_5.99.3flounder/5.99.35.99.3zheng_wenlong1-4/+4
Use appid between hss and apps, and check event destination in libhomescreen. So these is no need compare code when recived Event_TapShortcut Event. BUG-AGL: SPEC-1645 Change-Id: I3609a157ffdf31aa19cad6ae0f809f52e2129d0d Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-11-10Set default debug level to errorflounder_5.99.2flounder_5.99.1flounder/5.99.2flounder/5.99.1eel_4.99.3eel/4.99.35.99.25.99.14.99.3zheng_wenlong1-3/+4
Default enable HMI_ERROR output. Remove afb-binding.h and add necessary header files. [Patch Set 2] Change LOG_LEVEL_MAX value equal LOG_LEVEL_DEBUG. Change-Id: Ie50e267b9ff9ad107bb38162ad90acc410c79cbc Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-11-01Add a new OnScreenReply api to agl-service-homescreeneel_4.99.2eel/4.99.24.99.2zheng_wenlong2-3/+48
Add a new event named OnScreenReply. Applications can use this event to reply to the homescreen. Also update the documentation for this event. [Patch Sets 8,9] Update ApplicationGuide.md. For details: Use master source build agl-service-homescreen-2017. Change agl version to EE. Add libhomescreen sample code path. [Patch Sets 10] Delete tailing space. BUG-AGL: SPEC-985 Change-Id: Iea0c321731fa62cd94fc08fc5e303c20847fd525 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-10-30Add debug message macros controlled by environment variablezheng_wenlong2-14/+84
Add a HMI_DEBUG macro to print debug messages. It is controlled by the USE_HMI_DEBUG environment variable. BUG-AGL: SPEC-998 Change-Id: Ibb0a5c119a3a627538e7ec2728c64007f21af215 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-10-30Modify the library name in CmakeLists.txtzheng_wenlong1-14/+14
A wrong name is used in CMakeLists.txt (SM = soundmanager instead of HS = homescreen). Fix CMakeLists.txt by replacing SM with HS. BUG-AGL: SPEC-995 Change-Id: Id6273295982106705da0d63be89f50c05f4d6567 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-10-30Change comments from Japanese to Englishzheng_wenlong1-10/+9
There are some Japanese comments in RC1, change these to English. [Patch Sets 2] Split CMakeLists.txt due to modification in another commit. [Patch Sets 3] Update commit message. [Patch Sets 4] Return to Patch Sets 1 to rebase for this commit. <Delete libhomescreen from this gerrit repository> [Patch Sets 5] Return to Patch Sets 3 to rebase for this commit. <Modify library name in CMakeLists.txt> Change-Id: Ib520d39ede23cb0059f303c6e38090c9ed65a45b Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
2017-10-05Add agl-service-homescreen-2017zheng_wenlong5-0/+541
Add a new binding agl-service-homescreen-2017 for homescreen-2017. There is a gles sample how to use this binding in sample/simple-egl. A image about this see JIRA SPEC-871. [PatchSets2] Use aglwgt make package. Change-Id: I9ae89188f9eb2de4c98ec8baa2f05fccca8b2372 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>