W3C home > Mailing lists > Public > public-device-apis@w3.org > July 2016

Re: Notes of June 30 teleconference

From: Kostiainen, Anssi <anssi.kostiainen@intel.com>
Date: Tue, 5 Jul 2016 12:22:03 +0000
To: Marcos Caceres <marcos@marcosc.com>
CC: Dominique Hazael-Massieux <dom@w3.org>, W3C Device APIs WG <public-device-apis@w3.org>, Frederick Hirsch <w3c@fjhirsch.com>
Message-ID: <35D6C08A-E6B2-4792-9BFE-EB10AE893BE5@intel.com>
Hi Marcos,

> On 05 Jul 2016, at 08:15, Marcos Caceres <marcos@marcosc.com> wrote:
> On July 4, 2016 at 6:54:29 PM, Kostiainen, Anssi
> (anssi.kostiainen@intel.com) wrote:
>>> On 01 Jul 2016, at 11:12, Dominique Hazael-Massieux wrote:
>>> Given this, I would like to suggest that we should instead of a new
>>> Proposed Recommendation, fall back to Candidate Recommendation where we
>>> can evaluate the expected future implementations of the API, or evaluate
>>> mitigation strategies to the concerns you mentioned.
>> The mitigation strategies baked into the spec currently are the following:
>> * BatteryManager is gated behind a promise allowing implementations to leave the promise
>> in a pending state, for example, if no user consent is acquired. In particular, the promise
>> never rejects, as to not allow implementations to know whether the user did not grant
>> access or whether she just did not act on the request.
> This is not a good idea, IMO. We can't just leave promises in pending
> state or that will block the program from proceeding.

Domenic seems to disagree with your position:


>> * Implementations may obfuscate the exposed values, and/or adjust the precision of
>> the readouts as they see fit.
>> See also:
>> https://w3c.github.io/battery/#security-and-privacy-considerations
> This might be fine, but it doesn't address the underlying
> presupposition and use case: that this API is no longer needed because
> power management can be done better at the OS level instead of the
> application level.

I think we need to take another look at use cases.

Below are couple of use cases that came to my mind that would require app level power management:

* App adjusts the amount/number of messages/tweets/data it fetches over the network as well as the polling frequency depending on the battery level/plugged in state. If battery drops below 20% the app will only poll for new data if the user explicitly interacts with the app and clicks the "Update" button, otherwise the app fetches data without user interaction.

* App persists its state to cloud only if there's an increased risk of running out of battery. App does not want to persist the state unnecessarily since it is an expensive operation that also depletes battery (don't want to do it unless really needed).

* App will only start an expensive (in terms of battery) operation that must run to completion if the battery level is over 40%. For example, show a simpler map and not the fancy WebGL one if low on battery while using a web-based navigation app. (the navigation app knows how long it'll take to get to your destination, so can act accordingly).

* App will only start a long-running irreversible operation if the battery level is above certain threshold. For example, a very tedious checkout process, or an update of app assets (e.g. download of hi res textures for the new level in a web-based game).

All these could be enhanced with app level power management that would complement the power management decisions the OS makes. I think in an optimal scenario app and OS level would work in concert. For example, OS could still batch network requests from various apps/services in order to keep the radio up as little time as possible (to preserve battery), even if the app also does decisions based on battery status.

In reality some app developers will always abuse APIs. What I'd like to do in terms of the spec is to ensure we specify escape hatches as to allow implementations mitigate the impact when that happens, while still remain conformant with the spec.

>>> Frederick, Anssi, what do you think? There is a certain amount of time
>>> sensitiveness to this: we owe the Advisory Committee an update on the
>>> Battery API (since they reviewed it as a Proposed Recommendation quite a
>>> while ago), so I would like whatever next step we choose to be put in
>>> place next week if possible.
>> Let's fall back to CR.
> I agree, this would be good.


Received on Tuesday, 5 July 2016 12:22:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:33:33 UTC