Re: Trying to understand the Promise usage in the battery API

On 7/29/15 3:46 PM, Marcos Fábio Pereira wrote:
> Maybe in the future some hardware implementation needs some time to
> retrieve the battery level

But retrieving the battery level is sync in the spec.  Once you have the 
BatteryManager, you just hold on to it and call the sync "level" getter 
any time you want.

> and create the instance of BatteryManager in
> the first call of getBattery().

The BatteryManager is supposed to return the current level, not the 
level as of when it was created, right?

-Boris

Received on Wednesday, 29 July 2015 20:28:17 UTC