summaryrefslogtreecommitdiffstats
path: root/src/hs-clientmanager.cpp
AgeCommit message (Collapse)AuthorFilesLines
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-10hs-clientmanager: Pass arguments to printf() wrappersMarius Vlad1-4/+4
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 Vlad1-2/+57
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
2020-08-19hs-proxy: Keep track of clientCtx and client when starting applicationjellyfish_9.99.4jellyfish/9.99.49.99.4Marius Vlad1-0/+1
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 Vlad1-1/+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-05-26Fix CMake files and non-debug crashesScott Murray1-5/+8
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
2019-03-28Change log macro to AFB_XXXwang_zhiqiang1-8/+8
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_zhiqiang1-1/+37
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-01-16Improve homescreen-servicewang_zhiqiang1-290/+22
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_zhiqiang1-4/+12
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-14add new features in homescreen-service and homescreenwang_zhiqiang1-0/+146
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_zhiqiang1-8/+3
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_zhiqiang1-68/+165
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_zhiqiang1-3/+3
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_zhiqiang1-0/+219
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>