[Q] Determining the reason for the last wake

Hi. My first post. Long time lurker. Yay me. (Not sure this is exactly the right forum, but I don't see another more appropriate one... so here we go... mods can move if needed...)

In any case, I'm looking for an API within android, available either within the app framework or at the kernel level, which will give me the reason for the current wake. Meaning, I'd like to determine whether the processor/system was woken because of a user key press, a network packet, or an app alarm (RTC), and if it was requested by an app, which app.

I've browsed the java app APIs, as well as /proc and some parts of the kernel source, but haven't found anything. (I'm familiar with PowerManager and wake locks, etc., but as I undertand them they only indicate that an app is [might be] preventing the system from sleeping right now, not that it was responsible for waking the system this time.)

Could I get some pointers to some APIs or such to get this info?

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by myrl.langosh
2 hours ago
Last post by kuvalis.jillian
2 hours ago
Last post by reinger.janelle
1 hour ago
Last post by fredrick27
48 minutes ago
Last post by oda.mayert
2 hours ago
Last post by aric.stark
4 hours ago