Expose the GravitySensor API, which provides a 3-axis reading of the gravity force, to users.
Generic Sensor APIs, as well as other hardware-related APIs, can be controversial when it comes to interoperability because other browser engine developers have voiced privacy-related concerns. We believe the Chromium implementation addresses those concerns. Additionally, all the data exposed by this API can already be read by users in JavaScript by calculating gravity from the Accelerometer and LinearAccelerometer readings we already provide.
Yes, except for Mac. The readings are obtained directly from the platform on Android when possible, and implemented as a fusion sensor on top of the Accelerometer implementation otherwise (and in other OSes except for macOS). There is support for gravity sensors in the Linux kernel as well, but we need to write some extra logic to handle falling back to a fusion sensor if they are not present". Per https://groups.google.com/a/chromium.org/g/blink-dev/c/_IReUkNKF6o/m/Ed0eFyP5CAAJ, only older Mac laptops seem to ship with accelerometers. We currently only ship the Accelerometer interface on Macs, but not LinearAccelerometer, in order to support the older Device Orientation/Motion APIs. As such, there does not seem to make much sense to ship this API on Macs either.