Ticket #53 (accepted defect)
shutdown when battery level critical
| Reported by: | kimaidou | Owned by: | jblondon |
|---|---|---|---|
| Priority: | high | Milestone: | rev6 |
| Component: | distribution_improvement | Version: | rev3 |
| Severity: | major | Keywords: | battery shutdown |
| Cc: |
Description
Hi
When the battery level is critical, the system mus force shutdown to prevent bad issues
Change History
comment:2 Changed 3 years ago by kimaidou
For me, 10%, because after that the level decreases faster (i think). Why not do an option for this ? A warning would be great too.
comment:3 Changed 3 years ago by vcaron
We could skip that question if we would simply handle as gracefully as possible a sudden poweroff.
If the filesystem is journalized, and the battery icon is red and flashing dangerously when critical, isn't it acceptable to let the user handle this ? Either he ignores it and is ready to lose about 10sec of its last activity, either he shutdowns it properly. Of course, this imply that X apps handle X session save/restore.
AFAIK, regular smart phones don't shut down automatically, do they ?
comment:5 follow-up: ↓ 7 Changed 3 years ago by vcaron
What happens if I am far away on the phone
Then you had no activity for long enough, open file data has already been written on disk, either directly or in the journal. Ext3 automatically commits every 5sec for instance.
comment:6 follow-up: ↓ 9 Changed 3 years ago by rysiek
why not have the user choose? can't we implement this functionality, plus a simple settings manager:
warn me when battery level goes below:
- 15%
- 10%
- 5%
- never warn
shutdown automagically when battery level goes below:
- 15%
- 10%
- 5%
- never shut down automagically
this way, the functionality will be there for those that want/need it, but it will be possible to configure it or turn it off all together should somebody think it's superfluous.
there is a question of sane defaults with this approach, I'd say it would be "warn at 10%; never shut down automagically", but that's an entirely different issue.
point is, let's give the user the power to choose.
comment:7 in reply to: ↑ 5 Changed 3 years ago by lupin-de-mid
Replying to vcaron:
Then you had no activity for long enough, open file data has already been written on disk, either directly or in the journal. Ext3 automatically commits every 5sec for instance.
I had no activity, but my phone had activity - new sms, emails, missed call's
comment:8 Changed 3 years ago by vcaron
I had no activity, but my phone had activity - new sms, emails, missed call's
Those are punctual events, I guess they should be commit'ed immediatly (many email clients will commit-to-disk as soon as an email arrive in your Inbox).
My proposal might be stupid and unusable, I really don't know. I think "devices" should be turned off like any stateless light bulb. I'm dreaming a bit but...
comment:9 in reply to: ↑ 6 Changed 3 years ago by kimaidou
@ rysiek
Totally agree with this procedure : let the user choose ! I think being able to set both things (warning and force shutdown) would let people configure the phone as they want (not as the developer wants)
comment:10 Changed 3 years ago by jblondon
ok, so here is my proposal:
- 2 thresholds :
- the LOW BATTERY level
- the CRITICAL level
with CRITICAL < LOW BATTERY
When batt level < LOW BATTERY : alert (led blinking / sound)
When (batt level < CRITICAL) and (shutdown_auto == TRUE) : shutdown -h 0
When (batt level < CRITICAL) and (shutdown_auto != TRUE) : notification every minute
LOW BATTERY, CRITICAL, shutdown_auto, alert type (sound+led, soundonly, ledonly) will be stored in gconf.
Default values :
- LOW BATTERY : 10%
- CRITICAL : 5%
- shutdown_auto : true
- alert type : led blinking
comment:11 Changed 3 years ago by rysiek
another idea: maybe it would be a good idea to mount the root fs with those additional options:
data=journal,sync
the performance gains h1 achieves through using defaults here are minor, while - correct me if I'm wrong - above options would lessen the chance of having a corrupted/not usable filesystem/files after unclean shutdown.
comment:13 Changed 2 years ago by Deubeuliou
What is the state of this one ?
In rev4, I think the phone shtus down when there are only 2 minutes of battery left, and a popup appears, but I saw no led blinking and hear no sound.
comment:14 follow-up: ↓ 15 Changed 2 years ago by jblondon
@Deubeuliou : you are right, no led blinking and no sound. Btw this behavior is not handled by gsm but by the battery applet. I think it should be moved into neod.
comment:15 in reply to: ↑ 14 Changed 2 years ago by ppronchery
Replying to jblondon:
@Deubeuliou : you are right, no led blinking and no sound. Btw this behavior
is not handled by gsm but by the battery applet. I think it should be moved
into neod.
I fail to see any code about the LEDs inside the battery applet. Are you sure?
comment:16 Changed 2 years ago by jipey
Another issue is the phone does not power off while it is suspended and goes below the critical level. It should wake up to do a clean shutdown.

ok, what is the critical level : 20% ? 10%, 5% ?
i think neod could do this job very easily