Last Comment Bug 727477 - Battery API: On Galaxy Nexus, the Battery API reports "charging" and "full" even if not full and not plugged
: Battery API: On Galaxy Nexus, the Battery API reports "charging" and "full" ...
Status: RESOLVED FIXED
mwc-demo
:
Product: Core
Classification: Components
Component: Widget: Android (show other bugs)
: Trunk
: All Android
: -- normal (vote)
: mozilla13
Assigned To: Mounir Lamouri (:mounir)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-15 09:02 PST by Paul Rouget [:paul]
Modified: 2012-02-21 21:32 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
wontfix
affected
affected
fixed


Attachments
Patch (2.70 KB, patch)
2012-02-21 08:08 PST, Mounir Lamouri (:mounir)
doug.turner: review+
Details | Diff | Splinter Review

Description Paul Rouget [:paul] 2012-02-15 09:02:15 PST
I use this code: http://jsbin.com/ahovij/3

It works on HTC Desire HD + IRC.
On Galaxy Nexus, I get "level: 1, charging: true;" what ever the status of the battery is (plugged on not plugged, charged or not charged).
Comment 1 Mounir Lamouri (:mounir) 2012-02-15 09:49:15 PST
I've been told that by someone from dev engagement but I don't have a Galaxy Nexus.

What do you mean by HTC Desire HD + IRC?
Comment 2 Doug Turner (:dougt) 2012-02-15 10:38:48 PST
ROM Bug:
   http://code.google.com/p/android/issues/detail?id=22035
Comment 3 Paul Rouget [:paul] 2012-02-16 12:51:25 PST
(sorry, I meant ICS, not IRC)
Comment 4 Robert Nyman 2012-02-17 05:02:06 PST
Yes, I've seen the same thing on Galaxy Nexus, and like Doug pointed out, it seems to be due to a bug at their end.
Comment 5 Doug Turner (:dougt) 2012-02-17 17:50:25 PST
WONTFIX since our code works.  Please subscribe to the google bug if you are interested.
Comment 6 Mounir Lamouri (:mounir) 2012-02-17 18:29:33 PST
I prefer to reopen it because I guess there is a way to get the battery information on this phone a way or another given that likely the battery widget is working.
I will buy a Galaxy Nexus next week when back in Paris and have a look at that. Reopening and assigning to myself for that.
Comment 7 Naoki Hirata :nhirata (please use needinfo instead of cc) 2012-02-20 00:25:45 PST
WebAPI Web app includes the battery API in the demo.  Adding the whiteboard mwc-demo because of this.
Comment 8 Mounir Lamouri (:mounir) 2012-02-21 08:08:58 PST
Created attachment 599181 [details] [diff] [review]
Patch

This should work around the low level issue.

BTW, it's not an ICS issue. I tried with a Nexus S with ICS and things were working nicely.
Comment 9 Doug Turner (:dougt) 2012-02-21 15:22:28 PST
Comment on attachment 599181 [details] [diff] [review]
Patch

Review of attachment 599181 [details] [diff] [review]:
-----------------------------------------------------------------

if there are more devices that need to be special cased, we can factor that test out into its own function.
Comment 10 Mounir Lamouri (:mounir) 2012-02-21 15:35:03 PST
Pushed to m-c:
https://hg.mozilla.org/mozilla-central/rev/f754a314d61d

Should we take this fix to Firefox 11 and/or 12 given that it's really safe and will prevent people from complaining that this new feature we might advertise doesn't work on their phones?

Note You need to log in before you can comment on or make changes to this bug.