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: If254220ca3018bc6ec1c4e3947375733f6816f92
This commit is contained in:
Christian Göllner
2022-02-04 13:29:37 +01:00
parent 6e6527657e
commit 78a0e714c4
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;
}