Control lid behaviour with a Global setting
Using a global setting to specify the lid open/close behaviour
allows OEMs to support switching between windowed and windowless
lids at runtime instead of build time.
Bug: 70378569
Test: Find the hall effect sensor on the device and then using a magnet
confirm the expected behaviour for each global setting:
* No reaction from device
adb shell settings put global lid_behavior 0
* Sleep/screen off
adb shell settings put global lid_behavior 1
* Lock screen but screen stays on
adb shell settings put global lid_behavior 2
Change-Id: I53682711aeaaeb9eead7246ba83e4dd4b3c06a58
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 1530626..7de52cc 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -13047,6 +13047,15 @@
*/
public static final String LTE_SERVICE_FORCED = "lte_service_forced";
+
+ /**
+ * Specifies the behaviour the lid triggers when closed
+ * <p>
+ * See WindowManagerPolicy.WindowManagerFuncs
+ * @hide
+ */
+ public static final String LID_BEHAVIOR = "lid_behavior";
+
/**
* Ephemeral app cookie max size in bytes.
* <p>
diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
index 3a1a4fc..23cd963 100644
--- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java
+++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
@@ -319,6 +319,7 @@
Settings.Global.LOW_POWER_MODE_STICKY,
Settings.Global.LOW_POWER_MODE_SUGGESTION_PARAMS,
Settings.Global.LTE_SERVICE_FORCED,
+ Settings.Global.LID_BEHAVIOR,
Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE,
Settings.Global.MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY,
Settings.Global.MDC_INITIAL_MAX_RETRY,