How to keep service application working in screen off state

Locks and releases the given lock state for a specified time.
1
2
3
4
5
6
7
8
9
10
#include <device/power.h> 
int error;
error = device_power_request_lock(POWER_LOCK_CPU, 0);
// do your job here
error = device_power_release_lock(POWER_LOCK_CPU);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX