java - How do native methods on Android interact with the power management lifecycle? -
will android potentially enter deep sleep (cpu sleeping) while native method running?
if so,
can native method acquire wake lock using c calls?
will phone wake automatically when there data available native method blocking on socket read?
will phone wake automatically when there data available native method blocking on select or epoll?
if android not consider sleeping during native method invocation, how can ensure phone can go sleep until 1 of sockets created in native code has data ready receive?
some background:
the android site's jni tips suggests "android not suspend threads executing native code. if garbage collection in progress, or debugger has issued suspend request, android pause thread next time makes jni call." - appears reference suspension of individual threads rather putting phone suspend/sleep mode. other that, couldn't find specific comments suspend/sleep behavior.
to find more information android powermanagement natively want @ source documents
http://www.kandroid.org/online-pdk/guide/power_management.html
as using wakelock native documentation warns can destabilizer system doing so.
user space native libraries (any hardware function in //device/lib/hardware/ meant serve supporting libraries android runtime) should never call android power management directly (see image above). bypassing power management policy in android runtime destabilize system.
Comments
Post a Comment