diff options
| author | 2019-06-12 15:23:17 -0700 | |
|---|---|---|
| committer | 2019-06-17 23:56:52 +0000 | |
| commit | 7c7b8c28ca7c886ca112bd5a00e5fb8479fa2d36 (patch) | |
| tree | 122965d82ad09a20964853437503445a5967d3a5 | |
| parent | 24046b674c38027d3815bc84a3c06449f54dbc3f (diff) | |
Allow wake_lock_screen when AOD is off
Also decoupling the settings, so they can be configured
separately.
Fixes: 135023656
Test: manual
Test: adb shell settings put secure doze_wake_lock_screen_gesture 0
Test: adb shell settings put secure doze_wake_lock_screen_gesture 1
Change-Id: I2138d5d06919b9c23428663e49381fc1b694e301
3 files changed, 31 insertions, 12 deletions
diff --git a/core/java/android/hardware/display/AmbientDisplayConfiguration.java b/core/java/android/hardware/display/AmbientDisplayConfiguration.java index c45b8ed52187..3e995b624112 100644 --- a/core/java/android/hardware/display/AmbientDisplayConfiguration.java +++ b/core/java/android/hardware/display/AmbientDisplayConfiguration.java @@ -48,7 +48,8 @@ public class AmbientDisplayConfiguration { return pulseOnNotificationEnabled(user) || pulseOnLongPressEnabled(user) || alwaysOnEnabled(user) - || wakeScreenGestureEnabled(user) + || wakeLockScreenGestureEnabled(user) + || wakeDisplayGestureEnabled(user) || pickupGestureEnabled(user) || tapGestureEnabled(user) || doubleTapGestureEnabled(user); @@ -105,8 +106,14 @@ public class AmbientDisplayConfiguration { } /** {@hide} */ - public boolean wakeScreenGestureEnabled(int user) { - return boolSettingDefaultOn(Settings.Secure.DOZE_WAKE_SCREEN_GESTURE, user) + public boolean wakeLockScreenGestureEnabled(int user) { + return boolSettingDefaultOn(Settings.Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE, user) + && wakeScreenGestureAvailable(); + } + + /** {@hide} */ + public boolean wakeDisplayGestureEnabled(int user) { + return boolSettingDefaultOn(Settings.Secure.DOZE_WAKE_DISPLAY_GESTURE, user) && wakeScreenGestureAvailable(); } diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index d614fed6b168..8464545d735d 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -88,6 +88,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.MemoryIntArray; +import android.view.Display; import android.view.inputmethod.InputMethodSystemProperty; import com.android.internal.annotations.GuardedBy; @@ -4073,7 +4074,7 @@ public final class Settings { * preference, this rotation value will be used. Must be one of the * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. * - * @see android.view.Display#getRotation + * @see Display#getRotation */ public static final String USER_ROTATION = "user_rotation"; @@ -7731,12 +7732,21 @@ public final class Settings { private static final Validator DOZE_TAP_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; /** - * Gesture that wakes up the display, showing the ambient version of the status bar. + * Gesture that wakes up the display, showing some version of the lock screen. * @hide */ - public static final String DOZE_WAKE_SCREEN_GESTURE = "doze_wake_screen_gesture"; + public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture"; - private static final Validator DOZE_WAKE_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; + private static final Validator DOZE_WAKE_LOCK_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; + + /** + * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and + * {@link Display.STATE_DOZE}. + * @hide + */ + public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture"; + + private static final Validator DOZE_WAKE_DISPLAY_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; /** * Gesture that skips media. @@ -8962,7 +8972,8 @@ public final class Settings { DOZE_PICK_UP_GESTURE, DOZE_DOUBLE_TAP_GESTURE, DOZE_TAP_SCREEN_GESTURE, - DOZE_WAKE_SCREEN_GESTURE, + DOZE_WAKE_LOCK_SCREEN_GESTURE, + DOZE_WAKE_DISPLAY_GESTURE, NFC_PAYMENT_DEFAULT_COMPONENT, AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, FACE_UNLOCK_KEYGUARD_ENABLED, @@ -9134,7 +9145,8 @@ public final class Settings { VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR); VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR); VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR); - VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR); + VALIDATORS.put(DOZE_WAKE_LOCK_SCREEN_GESTURE, DOZE_WAKE_LOCK_SCREEN_GESTURE_VALIDATOR); + VALIDATORS.put(DOZE_WAKE_DISPLAY_GESTURE, DOZE_WAKE_DISPLAY_GESTURE_VALIDATOR); VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR); VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR); diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java index cdcf66040f2f..66b4ef47d1f8 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java @@ -127,15 +127,15 @@ public class DozeSensors { true /* touchscreen */), new PluginSensor( new SensorManagerPlugin.Sensor(TYPE_WAKE_DISPLAY), - Settings.Secure.DOZE_WAKE_SCREEN_GESTURE, + Settings.Secure.DOZE_WAKE_DISPLAY_GESTURE, mConfig.wakeScreenGestureAvailable() && alwaysOn, DozeLog.REASON_SENSOR_WAKE_UP, false /* reports touch coordinates */, false /* touchscreen */), new PluginSensor( new SensorManagerPlugin.Sensor(TYPE_WAKE_LOCK_SCREEN), - Settings.Secure.DOZE_WAKE_SCREEN_GESTURE, - mConfig.wakeScreenGestureAvailable() && alwaysOn, + Settings.Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE, + mConfig.wakeScreenGestureAvailable(), DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN, false /* reports touch coordinates */, false /* touchscreen */, mConfig.getWakeLockScreenDebounce()), |