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

@@ -103,12 +103,27 @@
<PreferenceCategory
android:title="@string/category_name_display_controls">
<!--
Standard auto-rotation preference that will be shown when device state based
auto-rotation settings are NOT available.
-->
<SwitchPreference
android:key="auto_rotate"
android:title="@string/accelerometer_title"
settings:keywords="@string/keywords_auto_rotate"
settings:controller="com.android.settings.display.AutoRotatePreferenceController"/>
<!--
Auto-rotation preference that will be shown when device state based auto-rotation
settings are available.
-->
<Preference
android:key="device_state_auto_rotate"
android:title="@string/accelerometer_title"
android:fragment="com.android.settings.display.DeviceStateAutoRotateDetailsFragment"
settings:keywords="@string/keywords_auto_rotate"
settings:controller="com.android.settings.display.DeviceStateAutoRotateOverviewController"/>
<SwitchPreference
android:key="display_white_balance"
android:title="@string/display_white_balance_title"