Bug 139253

Summary: battstat-applet-2 does not correctly reflect power status after resume
Product: [Fedora] Fedora Reporter: Alistair Riddoch <alriddoch>
Component: gnome-appletsAssignee: Mark McLoughlin <markmc>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: redhatbugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-05 13:33:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alistair Riddoch 2004-11-14 14:24:28 UTC
The battery applet does not correctly reflect the status of power on a
laptop system after the system has resumed from a suspended state. The
applet has an icon to indicate whether the laptop is on battery on
or AC power. This icon remains in the state it was in when the system
was suspended, presumably because it relies on events to notify it
of a change of state. If the system is resumed with the power system
in a different state to when it was suspended, the applet continues
to reflect the wrong state, and the battery charge/discharge time
calculations give confusing results because the battery charge is
changing in a different direction from the direction the applet expects.
This problem was observed on an IBM Thinkpad X24 using ACPI.

Version-Release number of selected component (if applicable):
gnome-applets-2.8.0-5

How reproducible:
Always

Steps to Reproduce:
1. Connect the system to AC power.
2. Suspend the system.
3. Disconnect from AC power.
4. Resume the system.

Actual Results:  The battery status applet show an icon indicating
that the system is on AC power, and has a tool tip giving a time that
the battery will take to   be fully charged.

Expected Results:  The battery status applet should indicate that the
system is on batter power, and the tool top should give the time
remaining before the battery is exhausted.

Comment 1 Mark McLoughlin 2004-11-15 08:53:11 UTC
What does 

  $> /proc/acpi/ac_adapter/AC/state

give you after you've resumed?

Comment 2 Alistair Riddoch 2004-11-15 11:30:43 UTC
/proc/acpi/ac_adapter/AC/state gives the correct status after resuming.

state:                   on-line

if the AC adaptor is connected, and:

state:                   off-line

if its not connected.

Comment 3 Matthew Flint 2004-11-24 22:36:18 UTC
I have a similar problem, might be related:

Power on my laptop from cold but with weak battery (Fujitsu Amilo D,
using ACPI, was working perfectly with FC2) and the battstat applet
says "98% charged, on ac power" when the machine has been running off
battery for an hour.

Then it corrects itself (ie, 15% charged, battery discharging) when I
manually query /proc/acpi. ("cat /proc/acpi/battery/BAT1/state" or
"cat /proc/acpi/ac_adapter/ACAD/state")

Battstat applet v2.8.0, kernel 2.6.9-1.681_FC3

Comment 4 Mark McLoughlin 2005-01-05 13:33:02 UTC
Logged this bug upstream:

 http://bugzilla.gnome.org/show_bug.cgi?id=163013