I'm trying to build a standBy like activity, and I'm near to my goal, the only issue that I found is that sometimes after I switch off the screen Android turn it on immediately and I can't understand why.
I have a terminal linked to a proprietary board, when I launch a specific activity I'm able to let the board send a message to my device to turn off the screen. The result is that the screen turn off, but only for a moment, because immediately Android turn on the screen.
Here is the log of my application
I/ProprietaryStandbyActivity(31326): onCreate
I/ProprietaryStandbyActivity(31326): terminalDisplayOff 192.168.0.123
Sending UDP message to turn Off the screen
D/WindowManager( 2147): mBootFastRuning = false shutdhownPending = false
D/InputManager-JNI( 2147): handleInterceptActions: Not passing key to user.
D/OpenGLRenderer(31326): Enabling debug mode 0
I/ActivityManager( 2147): Displayed ProprietaryStandbyActivity: +208ms
D/WindowManager( 2147): mBootFastRuning = false shutdhownPending = false
D/InputManager-JNI( 2147): handleInterceptActions: Going to sleep.
D/InputManager-JNI( 2147): handleInterceptActions: Not passing key to user.
I/PowerManagerService( 2147): Going to sleep by user request...
I/LQ ( 2147): ########## Thread(StopWifi).start( !!!!
D/SurfaceFlinger( 1302): Screen released, type=0 flinger=0xb84ed450
E/IMGSRV ( 1302): :0: ####hwc_device_blank: disp:0 blank:1
V/ProprietaryStandbyActivity(31326): Called onPause
I/ProprietaryStandbyActivity(31326): onStop
D/PowerManagerService-JNI( 2147): Excessive delay in autosuspend_enable()
while turning screen off: 380ms
D/UdpExecutor(30580): ###UDP socket listening...
D/WindowManager( 2147): mBootFastRuning = false shutdhownPending = false
D/InputManager-JNI( 2147): handleInterceptActions: Waking up.
D/SensorManager( 2147): >>>>>>> set discard sensrtime =3
E/&&&&&& ( 2147): /data/user/gsensor_data ----> not exists.
D/InputManager-JNI( 2147): handleInterceptActions: Not passing key to user.
D/SurfaceFlinger( 1302): Screen acquired, type=0 flinger=0xb84ed450
E/IMGSRV ( 1302): :0: ####hwc_device_blank: disp:0 blank:0
I/PowerManagerService( 2147): Waking up from sleep...
V/KeyguardServiceDelegate( 2147): onScreenTurnedOn(showListener =
com.android.internal.policy.impl.PhoneWindowManager$18@41da4ae0)
V/KeyguardServiceDelegate( 2147): **** SHOWN CALLED ****
I/WindowManager( 2147): No lock screen! windowToken=null
The strange log that I can't understand is this line
D/InputManager-JNI( 2147): handleInterceptActions: Waking up.
It seems that somehow the InputManager class receive an input to wake up the screen, even if I give no input. Does someone know why this happens?