Merge lp://staging/~gerboland/qtmir/RTM-fix-lifecycle-exempt-keeps-wakelock into lp://staging/qtmir/rtm-14.09

Proposed by Gerry Boland
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 301
Merged at revision: 295
Proposed branch: lp://staging/~gerboland/qtmir/RTM-fix-lifecycle-exempt-keeps-wakelock
Merge into: lp://staging/qtmir/rtm-14.09
Diff against target: 1184 lines (+653/-249)
15 files modified
debian/control (+2/-0)
src/common/abstractdbusservicemonitor.cpp (+2/-3)
src/common/abstractdbusservicemonitor.h (+1/-7)
src/modules/Unity/Application/Application.pro (+1/-1)
src/modules/Unity/Application/application.cpp (+3/-1)
src/modules/Unity/Application/application_manager.cpp (+5/-2)
src/modules/Unity/Application/sharedwakelock.cpp (+120/-57)
src/modules/Unity/Application/sharedwakelock.h (+14/-9)
tests/modules/Application/application_test.cpp (+7/-7)
tests/modules/ApplicationManager/application_manager_test.cpp (+78/-0)
tests/modules/SharedWakelock/SharedWakelock.pro (+11/-0)
tests/modules/SharedWakelock/sharedwakelock_test.cpp (+365/-146)
tests/modules/common/common.pri (+2/-1)
tests/modules/common/mock_shared_wakelock.h (+41/-14)
tests/modules/modules.pro (+1/-1)
To merge this branch: bzr merge lp://staging/~gerboland/qtmir/RTM-fix-lifecycle-exempt-keeps-wakelock
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Gerry Boland (community) Abstain
Review via email: mp+251131@code.staging.launchpad.net

Commit message

Refactor wakelock handling. Lifecycle exempt apps now release wakelock when shell tries to suspend them

The previous Wakelock RAII design was faulty as it was wrapping an asynchronous service. It made it possible for wakelocks to be acquired and not be released.

This refactors SharedWakelock to hold a single instance of Wakelock, and Wakelock always holds a DBus connection.

Testing now includes testing the DBus calls are actually emitted.

Adds dependency on libqtdbusmock1-dev and libqtdbustest1-dev

To post a comment you must log in.
296. By Gerry Boland

Add test

Revision history for this message
Gerry Boland (gerboland) wrote :

2 wakelocks somehow acquired with this by the Music app, something wrong

review: Needs Fixing
297. By Gerry Boland

Refactor wakelock handling. Lifecycle exempt apps now release wakelock when shell tries to suspend them

The previous Wakelock RAII design was faulty as it was wrapping an asynchronous service. It made it possible for wakelocks to be acquired and not be released.

This refactors SharedWakelock to hold a single instance of Wakelock, and Wakelock always holds a DBus connection.

Testing now includes testing the DBus calls are actually emitted.

Adds dependency on libqtdbusmock1-dev and libqtdbustest1-dev

298. By Gerry Boland

Fix acquire(), release(), acquire() being called in quick succession, and only after do 2 cookies get sent from dbus

299. By Gerry Boland

Fix and add test for SharedWakelock acq/rel/acq not loosing a cookie

Revision history for this message
Gerry Boland (gerboland) wrote :

Is good now.

review: Abstain
300. By Gerry Boland

Delete unnecesary line

301. By Gerry Boland

Racey test not so reliable, this helps

Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
No CI, but i compiled and ran the tests on a krillin

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches