power: add padding timer to power lock
- If Power Lock timeout (10 minutes) is expired during apps do
something with reference count 0 for very short time,
Power Lock will be released. Thus Suspend mode can be entered.
(Problem example)
==============================================================
Time | Music player | device-power | libtracker
==============================================================
00:00 power lock power lock
add timer
play start ref count:1
--------------------------------------------------------------
09:50 play stop ref count:0
search music
--------------------------------------------------------------
10:00 timer expired
check ref count (== 0)
-> power unlock
--------------------------------------------------------------
10:10 search done
play start ref count:1
--------------------------------------------------------------
After
few < Power Suspend Mode >
minutes
==============================================================
- To fix the issue, power lock api uses the padding timeout
whose callback is called after 20 seconds of power lock timeout.
Apps can do something without increasing reference count.
If the ref count is still 0 after 20 seconds, the Power Lock
will be released.
- If the ref count is changed during 20 seconds but the value is
still 0, Power Lock should not be released. Thus libtracker
supports the total reference count which means the accumulated
ref count. Thus The accumulated ref count is checked if the
ref count is still 0.
Change-Id: I307fbda4313d14fec2a4a31640096020c3c21485
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
Signed-off-by: taeyoung <ty317.kim@samsung.com>