Re: [device-posture] Fetching the posture type should be async? (#78)

> Why can't we cache these values instead? I mean if the site has access to the device posture, then it will be notified when it changes and then we can store the last value and always return the current one.

We can cache the value of the posture for sure. The problem is the initial call to the API, the browser doesn't have access to the posture yet until we access the sensors, get readings and determine the posture. From a browser implementation standpoint one alternative is to spin up the hinge sensor readings (on foldable devices only) regardless if a page will use the API or not so we always have a fresh value. Maybe at a lower resolution to keep battery usage low. I will have to discuss with the Chromium community about that.

As I commented the problem is only temporary until OSes get support for fetching the posture just like the orientation (and thus make it more efficient). But we're not guaranteed that support will ever come.


-- 
GitHub Notification of comment by darktears
Please view or discuss this issue at https://github.com/w3c/device-posture/issues/78#issuecomment-869768513 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 28 June 2021 15:11:44 UTC