Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keepalive functionality for C programs that utilize glib mainloop #7

Merged
merged 9 commits into from Jan 12, 2015

Conversation

spiiroin
Copy link
Contributor

Originally keepalive functionality was written with only Qt and
QML applications in mind. This meant that system daemons and
middleware components that need to deal with waking up from suspend
and/or staying out of suspend had to use lower level services directly.

Implement feature-wise similar interface for use from glib based
programs as what is available for Qt/QML applications.

Interfaces provided:

  • keepalive-displaykeepalive.h disable based display dimming/blanking
  • keepalive-cpukeepalive.h disable autosuspend policy
  • keepalive-heartbeat.h wake up from suspend via iphb service
  • keepalive-backgroundactivity.h periodic wakeups with suspend blocking
  • keepalive-timeout.h suspend aware g_timeout_add like functionality

Also includes simple example applications.

Originally keepalive functionality was written with only Qt and
QML applications in mind. This meant that system daemons and
middleware components that need to deal with waking up from suspend
and/or staying out of suspend had to use lower level services directly.

Implement feature-wise similar interface for use from glib based
programs as what is available for Qt/QML applications.

Interfaces provided:
* keepalive-displaykeepalive.h disable based display dimming/blanking
* keepalive-cpukeepalive.h disable autosuspend policy
* keepalive-heartbeat.h wake up from suspend via iphb service
* keepalive-backgroundactivity.h periodic wakeups with suspend blocking
* keepalive-timeout.h suspend aware g_timeout_add like functionality

Also includes simple example applications.

[nemo-keepalive] Add keepalive functionality for C programs that utilize glib mainloop. Fixes JB#25180
The doing rpm build the relative path to the spec file might not be
the same as it is in the source tree.

When doing rpm build, feed the version info to make from spec rule.
When doing local build with make, dig it from the spec file.
Missing requirements went unnoticed while doing local builds without OBS.
@monich
Copy link
Member

monich commented Dec 19, 2014

It's entirely up to you but I would like to point out that gcc is capable of generating dependencies without any help from external scripts, e.g.

https://github.com/nemomobile/mms-engine/blob/master/mms-lib/Makefile

Was initially added to install phase make invocation only.
@spiiroin
Copy link
Contributor Author

@monich: The main purpose for filtering gcc -MM results is to generate separate dependencies for position independent objects targeting dynamic libraries (%.pic.o) from normal compilation targeting executables and/or static libraries (%.o). IIRC there were also other oddities that needed fixing, but since this filtering approach has worked for me it has been a while since I last checked how things work by default nowadays...

Also document the fact that xxx_unref() and xxx_ref() functions by design
allow using NULL pointers.

And fix background_activity_is_stopped() that tested wrong state due
to copy-paster error.
The intention is that the helper scripts have the same license
as the actual code does.
spiiroin added a commit that referenced this pull request Jan 12, 2015
Add keepalive functionality for C programs that utilize glib mainloop
@spiiroin spiiroin merged commit f84fa69 into nemomobile:master Jan 12, 2015
@spiiroin spiiroin deleted the jb25180_glib_api branch January 12, 2015 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants