Hello there! I'm a long time listener, first time caller. I've read the posting guidelines and though this is a unique device feature, foldables are a growing part of the Android market and it's a native (far as I can tell) Android API to read device hinge angle, so I felt this merited mention and request.
Devices such as the Samsung Fold/Flip, Moto Razr foldables have a device hinge angle sensor that reports back to the OS the angle state. This allows the OS to turn off the foldable screen when folded closed, and utilize the external-facing display instead. From my tests on the Samsung Z Flip this sensor reports 0 degrees, 90 degrees, and 180 degrees. It does not appear to record any angles more granular than that, but that's 3 useful Triggers or Constraints for MacroDroid automations.
Using Device Hinge Angle sensor results as a trigger, or constraint, opens a world of other combinations of actions within MacroDroid.
For example:
Trigger:
Devices such as the Samsung Fold/Flip, Moto Razr foldables have a device hinge angle sensor that reports back to the OS the angle state. This allows the OS to turn off the foldable screen when folded closed, and utilize the external-facing display instead. From my tests on the Samsung Z Flip this sensor reports 0 degrees, 90 degrees, and 180 degrees. It does not appear to record any angles more granular than that, but that's 3 useful Triggers or Constraints for MacroDroid automations.
● Why this is needed?
Using Device Hinge Angle sensor results as a trigger, or constraint, opens a world of other combinations of actions within MacroDroid.
For example:
- hinge-angle=0 degrees then turn on power saving, play custom sound, turn off wireless radios, etc.
- hinge-angle=90 degrees then turn on tethering, launch camera, turn on flashlight, multi-window, video conference app, etc.
- hinge-angle=180 degrees then play custom sound, turn off power saving
Trigger:
- Display turned on
- Constraint: hinge-angle =/greater than 90 degrees
- Play sound: Custom sound
- Turn off battery saver