Why the device suddenly shuts down itself while I using my hacky program?

2.1k views Asked by At

I use my hacky program to "modulate" backlight between off and minimum. (I want really dim backlight sometimes and use both it and ScreenFilter simultaneously). However, in some modes when using it the device suddenly begins shutting down without any questions or confirmations:

I/ActivityManager( 1138): Starting activity: Intent { act=android.intent.action.ACTION_REQUEST_SHUTDOWN flg=0x10000000 cmp=android/com.android.server.ShutdownActivity (has extras) }

Why does it happen? How to prevent those spurious shutdowns?

@link How to prevent shutdown on low power

1

There are 1 answers

2
ProjectJourneyman On

Have you tried changing the light/dark time to see if it only happens at a certain frequency? It's possible the system panics and thinks something has gone wrong if it sees too many changes too quickly.

I'm just guessing, but also consider that you have an infinite loop at a very low level. Rather than do an ANR, I suspect that the only option the OS has to escape is to reboot.