Battery API: On Galaxy Nexus, the Battery API reports "charging" and "full" even if not full and not plugged

RESOLVED FIXED in Firefox 13

Status

()

Core
Widget: Android
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: paul, Assigned: mounir)

Tracking

Trunk
mozilla13
All
Android
Points:
---

Firefox Tracking Flags

(firefox10 wontfix, firefox11 affected, firefox12 affected, firefox13 fixed)

Details

(Whiteboard: mwc-demo)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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).
(Assignee)

Comment 1

6 years ago
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?
Component: General → DOM: Device Interfaces
OS: Linux → Android
QA Contact: general → device-interfaces
Hardware: x86_64 → All

Updated

6 years ago
Assignee: nobody → doug.turner
Component: DOM: Device Interfaces → General
OS: Android → Linux
Hardware: All → x86_64

Comment 2

6 years ago
ROM Bug:
   http://code.google.com/p/android/issues/detail?id=22035
(Reporter)

Comment 3

6 years ago
(sorry, I meant ICS, not IRC)

Comment 4

6 years ago
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

6 years ago
WONTFIX since our code works.  Please subscribe to the google bug if you are interested.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WONTFIX
(Assignee)

Comment 6

6 years ago
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.
Assignee: doug.turner → mounir
Status: RESOLVED → REOPENED
OS: Linux → Android
Hardware: x86_64 → All
Resolution: WONTFIX → ---
WebAPI Web app includes the battery API in the demo.  Adding the whiteboard mwc-demo because of this.
Whiteboard: mwc-demo
(Assignee)

Comment 8

6 years ago
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.
Attachment #599181 - Flags: review?(doug.turner)

Comment 9

6 years ago
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.
Attachment #599181 - Flags: review?(doug.turner) → review+
(Assignee)

Comment 10

6 years ago
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?
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
status-firefox10: --- → wontfix
status-firefox11: --- → affected
status-firefox12: --- → affected
status-firefox13: --- → fixed
Component: General → Widget: Android
QA Contact: device-interfaces → android
Resolution: --- → FIXED
Target Milestone: --- → mozilla13

Updated

6 years ago
Blocks: 728249

Updated

6 years ago
No longer blocks: 728249
You need to log in before you can comment on or make changes to this bug.