AOD: selectively register sensors that use prox

Allow some devices to only register sensors that use prox when
the display state is off or in doze on certain devices to
avoid white prox dot behind display.

The delay shouldn't be perceptible - when the device isn't in low-power
mode yet, we rely on regular touch from the display.

Test: manual, atest DozeSensorsTest, atest DozeTriggersTests
Fixes: 181835575
Change-Id: Ib62ed0ca3150e0a3939c8d9f0c5ae700fd6a61d7
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 6e61148..4689fb8 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -174,6 +174,23 @@
     <!-- Doze: check proximity sensor before pulsing? -->
     <bool name="doze_proximity_check_before_pulse">true</bool>
 
+    <!-- Doze: only register sensors that use prox when device is in certain Display states. This
+     delays registering sensors when device first shows dozing UI but the
+     Display & Power state hasn't changed to low-power mode yet. -->
+    <bool name="doze_selectively_register_prox">false</bool>
+
+    <!-- Doze: whether the single tap sensor uses the proximity sensor.
+     If both this parameter and doze_selectively_register_prox are true, registration for the
+     sensor will be delayed when the device first enters dozing but the device has not entered its
+     low powered state yet. -->
+    <bool name="doze_single_tap_uses_prox">true</bool>
+
+    <!-- Doze: whether the long press sensor uses the proximity sensor.
+     If both this parameter and doze_selectively_register_prox are true, registration for the
+     sensor will be delayed when the device first enters dozing but the device has not entered its
+     low powered state yet. -->
+    <bool name="doze_long_press_uses_prox">true</bool>
+
     <!-- Doze: should notifications be used as a pulse signal? -->
     <bool name="doze_pulse_on_notifications">true</bool>