2

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

Community
  • 1
  • 1
Vi.
  • 37,014
  • 18
  • 93
  • 148
  • Dev questions are off-topic here; migrating to [SO]. – Matthew Read Oct 31 '11 at 15:25
  • Supposition: changing the backlight level too fast can affect reported battery level. When it reports 0% it triggers shutdown. Can it be? What log messages are when it shuts down because of power? – Vi. Nov 15 '11 at 19:51

1 Answers1

0

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.

ProjectJourneyman
  • 3,566
  • 1
  • 27
  • 37
  • 1
    The loop is running in background (with a realtime priority although), other applications running. But the phone suddenly shuts itself down correctly, but without confirmation. Nothing particular in logs. – Vi. Nov 17 '11 at 08:19
  • 1
    The system shuts down because of battery charge/voltage is sometimes misreported when brightness is toggled too fast (BTW on my laptop it is also the case). When Android see 0% 0V it decides to shut down. – Vi. Jan 12 '12 at 19:12