I want my application not to go in sleep state.
Then use a WakeLock
.
I dont want to use the PARTIAL_WAKELOCK mechanism to keep the battery life long.
You do not have a choice.
Here, The intention of having some PARTIAL_WAKELOCK like functionality not because of the service, I want it just for few threads(tasks).
A WakeLock
does not affect a service. It does not affect a "few threads". It affects the device's CPU. The CPU is what goes to sleep, not your service, and not your threads. If you do not want the CPU to go to sleep, you must use a WakeLock
.