Foldable rotation settings: persist postures instead of device states
Device state ids can change, and therefore shouldn't be persisted. We
define our custom ids for device postures, which will not change.
1. We define our custom posture ids in Settings.Secure. These match
the current device state ids. This way we don't have to wipe users'
settings.
2. We convert device ids to postures, based on the config arrays
"config_foldedDeviceStates", "config_halfFoldedDeviceStates", and
"config_openDeviceStates".
Test: unit tests
Test: manually by trying the different auto-rotation scenarios in
different postures.
Fixes: 261968395
Change-Id: I396e9c92230e75e186b6a70198ee16b41e508a1e
diff --git a/packages/SettingsLib/DeviceStateRotationLock/Android.bp b/packages/SettingsLib/DeviceStateRotationLock/Android.bp
index c642bd1..103309a 100644
--- a/packages/SettingsLib/DeviceStateRotationLock/Android.bp
+++ b/packages/SettingsLib/DeviceStateRotationLock/Android.bp
@@ -10,7 +10,10 @@
android_library {
name: "SettingsLibDeviceStateRotationLock",
- srcs: ["src/**/*.java"],
+ srcs: [
+ "src/**/*.java",
+ "src/**/*.kt",
+ ],
min_sdk_version: "21",
}