Re: no longer possible to detect battery presence? RE: Battery API in Last Call

On 12/02/2011 01:10 AM, Carr, Wayne wrote:
> You can tell now whether there is a battery or not except when the battery is full.  So there is just a window when you don't know - when apps are told they are charging when they actually are discharging.  So I don't think it has anything to do with privacy.

The fact that it's not possible to differentiate a full battery charging 
and no battery helps for privacy because it makes fingerprinting harder. 
In addition, it makes sure that users using desktops will end up in the 
code path made for fully charged devices.

You seem to complain because the API doesn't let the webapp know if 
there is a battery or not in the device but do you actually need that? 
If yes, I would be interested in the use case. While discussing this, 
the only use case that was mentioned was a system UI for the battery 
which is a tiny use case that could be fulfilled with another API or a 
future version of the API (very likely requiring permissions).

> If you have a full battery and disconnect your power source,  the spec says to report that the battery is charging --  even though it really is discharging.

That is a bug in the specs and should be raised separately.

Thanks,
--
Mounir

Received on Friday, 2 December 2011 13:33:31 UTC