Locking launching of widget during reinstallation/uninstallation
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 24 Oct 2013 10:57:00 +0000 (12:57 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Fri, 25 Oct 2013 11:00:30 +0000 (13:00 +0200)
commit3b7e85cfbc7948b0327cba3b827d9efd9a131d53
tree8bbbcb9306b4cea25ea4dccb056d31974a9e7480
parent01cd6f6d1a719bbc91dc6af8c723322b6e9f8db8
Locking launching of widget during reinstallation/uninstallation

[Issue#]   N_SE-55833
[Problem]  Installer should block launching widget during installation
[Cause]    N/A
[Solution] Reinstallation/deinstallation is making exclusive file lock on /tmp/.dpl_lock.[tizenId] file.
           Lock of this file is used to check by wrt-client if launching is possible.

[Remarks]
    - lock is destroyed if wrt-installer finished (destrcutor of std::unique_ptr<>)
    - lock is destroyed if wrt-installer crashed,
    - if file is already lock that means:
        - another installation of this widget is proceeded,
        - wrt-client check if it can launch -> wait for freeing

[SCMRequest]  This requires wrt-commons change: "[DPL] FileLock"
[Verification] N/A
    - try to run widget while widget is being resinstalled -> widget should not run (insert sleep code after kill runnign app),
    - try to run widget while widget is being uninstalled -> widget should not run,
    - install two different apps similtonously (both should be installed and able to be run)

Change-Id: Iedf3f954536d35085ae90eb3a58386abcab7f9ac
src/jobs/widget_install/task_configuration.cpp
src/jobs/widget_install/task_configuration.h
src/jobs/widget_install/widget_install_context.h
src/jobs/widget_uninstall/task_check.cpp
src/jobs/widget_uninstall/task_check.h
src/jobs/widget_uninstall/uninstaller_context.h