Add support for device state based auto-rotation preferences in Settings.

- Creates new preferences that are shown when device-state rotation
  is supported.
- Hides standard preferences when device-state rotation is supported.
- Controllers/Preferences for individual folded/unfolded rotation
  settings are created and added programatically based on the settable
  device states available.

Test: Manually + Unit tests
Bug: 195757480
Change-Id: I16f50fd3664756b363c7eb79e5c35eb0d3b6df17
This commit is contained in:
Christian Göllner
2022-02-17 11:32:54 +00:00
parent a01477087c
commit ff9065ac95
24 changed files with 1106 additions and 14 deletions

View File

@@ -77,6 +77,7 @@ public class SmartAutoRotatePreferenceController extends TogglePreferenceControl
@Override
public int getAvailabilityStatus() {
return RotationPolicy.isRotationLockToggleVisible(mContext)
&& !DeviceStateAutoRotationHelper.isDeviceStateRotationEnabled(mContext)
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}