sensors
sensors copied to clipboard
Background support for sensors APIs
Currently the sensors spec does not seem to really address if and how sensors could be used in background contexts (although I see there is issue #12 which mentions sensors should be at least exposed to service workers). Are more advanced background use cases considered to be in scope for the generic sensors API? I wrote up some thoughts and use cases on what I think using a sensor from the background means. Does any of that seem like something that could or should be part of (some version of) the generic sensors API?
Thanks for the issue and use cases and thoughts on the topic.
This is unfortunately out of scope for V1. I'm keeping it open for V2.
From the Android P documentation [1],
Limited access to sensors in background Android 9 limits the ability for background apps to access user input and sensor data. If your app is running in the background on a device running Android 9, the system applies the following restrictions to your app: Your app cannot access the microphone or camera. Sensors that use the continuous reporting mode, such as accelerometers and gyroscopes, don't receive events. Sensors that use the on-change or one-shot reporting modes don't receive events.
[1] https://developer.android.com/about/versions/pie/android-9.0-changes-all