From PowerManagerService a trace has displayed the following code
flow:
PowerManagerService.java ==>
Power.setScreenState(boolean) (Native) ==>
setScreenState(JNIEnv *env, jobject clazz, jboolean on)
(android_os_Power.cpp) ==>
set_screen_state(int) (power.c)
I guess as it is going to JNI and writing the value inside /sys/power/
state it is no longer controlled by Android Framework. Thank you for
the clarification.
One more query related to this question; when it goes to kernel, it
must be handled by kernel PowerManager. Now does kernel PM call the
suspend callback or early_suspend callback of the display or
touchscreen driver?