Android 11 introduced a hinge angle sensor type to represent a sensor that measures the angle between two integral parts of a device.
The current sample doesn't use that but a different approach. A nice upgrade could be to update the sample and use this new sensor type.
More info: