Re: [battery] Still some questions on battery status

Hi Cathy,

On Sep 7, 2011, at 21:47 , <Cathy.Chan@nokia.com> <Cathy.Chan@nokia.com> wrote:
> Further down in the definition for the batteryok event, the event is to be
> dispatched when
> 	[[ isPlugged changes its value to true ]]
> From this, the status could not be "ok". What then should be the value of
> status?

I think that you're drawing the wrong inference here. When isPlugged changes to true, batteryok is dispatched. But that doesn't mean that when isPlugged changes to false, then the status cannot be okay. Essentially:

  if isPlugged or level > low then status = ok

> 2. Regarding isPlugged, the current prose is
> [[ Represents whether the device is plugged in. If the device is plugged in
> and its battery is being charged or is at its full capacity, then isPlugged
> must be set to true, otherwise false. ]]
> What would be the value of isPlugged if an implementation is only able to
> determine whether the device is (literally) plugged in, but could not
> determine the power level or status (i.e. it would set level=null and
> status=null)? Should it be true or false?

I guess that this shows up in cases in which the device is plugged in but does not have a battery. Quite a lot of devices support this (not to mention devices such as desktops and TVs that might not have a battery at all — for consistency one could want to still support this API there) so it should be defined. I think that if you're plugged in and either don't have a battery or can't determine its level, isPlugged should be true and status should be ok.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Thursday, 8 September 2011 09:02:30 UTC