Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78ba0168 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "make wake event trigger a pulse"

parents 978ce92a de64ee01
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -68,10 +68,10 @@ public class AmbientDisplayConfiguration {

    public boolean wakeLockScreenGestureEnabled(int user) {
        return boolSettingDefaultOn(Settings.Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE, user)
                && wakeLockScreenGestureAvailable();
                && wakeScreenGestureAvailable();
    }

    public boolean wakeLockScreenGestureAvailable() {
    public boolean wakeScreenGestureAvailable() {
        return mContext.getResources()
                .getBoolean(R.bool.config_dozeWakeLockScreenSensorAvailable);
    }
@@ -81,10 +81,6 @@ public class AmbientDisplayConfiguration {
                && wakeScreenGestureAvailable();
    }

    public boolean wakeScreenGestureAvailable() {
        return !TextUtils.isEmpty(wakeScreenSensorType());
    }

    public String doubleTapSensorType() {
        return mContext.getResources().getString(R.string.config_dozeDoubleTapSensorType);
    }
@@ -93,10 +89,6 @@ public class AmbientDisplayConfiguration {
        return mContext.getResources().getString(R.string.config_dozeLongPressSensorType);
    }

    public String wakeScreenSensorType() {
        return mContext.getResources().getString(R.string.config_dozeWakeScreenSensorType);
    }

    public boolean pulseOnLongPressEnabled(int user) {
        return pulseOnLongPressAvailable() && boolSettingDefaultOff(
                Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, user);
+0 −3
Original line number Diff line number Diff line
@@ -2160,9 +2160,6 @@
    <!-- If the sensor that wakes up the lock screen is available or not. -->
    <bool name="config_dozeWakeLockScreenSensorAvailable">false</bool>

    <!-- Type of the wake up sensor. Empty if not supported. -->
    <string name="config_dozeWakeScreenSensorType" translatable="false"></string>

    <!-- Control whether the always on display mode is available. This should only be enabled on
         devices where the display has been tuned to be power efficient in DOZE and/or DOZE_SUSPEND
         states. -->
+0 −1
Original line number Diff line number Diff line
@@ -3499,7 +3499,6 @@

  <java-symbol type="integer" name="db_wal_truncate_size" />
  <java-symbol type="integer" name="config_wakeUpDelayDoze" />
  <java-symbol type="string" name="config_dozeWakeScreenSensorType" />

  <!-- For Bluetooth AbsoluteVolume -->
  <java-symbol type="fraction" name="config_prescaleAbsoluteVolume_index1" />
+3 −10
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ public class DozeLog {
    private static final int SIZE = Build.IS_DEBUGGABLE ? 400 : 50;
    static final SimpleDateFormat FORMAT = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");

    private static final int REASONS = 8;
    private static final int REASONS = 9;

    public static final int PULSE_REASON_NONE = -1;
    public static final int PULSE_REASON_INTENT = 0;
@@ -46,6 +46,7 @@ public class DozeLog {
    public static final int PULSE_REASON_SENSOR_LONG_PRESS = 5;
    public static final int PULSE_REASON_DOCKING = 6;
    public static final int REASON_SENSOR_WAKE_UP = 7;
    public static final int PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN = 8;

    private static boolean sRegisterKeyguardCallback = true;

@@ -177,15 +178,6 @@ public class DozeLog {
        log("state " + state);
    }

    /**
     * Appends lock screen wake up event to the logs.
     * @param wake if we're waking up or sleeping.
     */
    public static void traceLockScreenWakeUp(boolean wake) {
        if (!ENABLED) return;
        log("wakeLockScreen " + wake);
    }

    /**
     * Appends wake-display event to the logs.
     * @param wake if we're waking up or sleeping.
@@ -213,6 +205,7 @@ public class DozeLog {
            case PULSE_REASON_SENSOR_DOUBLE_TAP: return "doubletap";
            case PULSE_REASON_SENSOR_LONG_PRESS: return "longpress";
            case PULSE_REASON_DOCKING: return "docking";
            case PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN: return "wakelockscreen";
            case REASON_SENSOR_WAKE_UP: return "wakeup";
            default: throw new IllegalArgumentException("bad reason: " + pulseReason);
        }
+9 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.doze;

import static com.android.systemui.plugins.SensorManagerPlugin.Sensor.TYPE_WAKE_DISPLAY;
import static com.android.systemui.plugins.SensorManagerPlugin.Sensor.TYPE_WAKE_LOCK_SCREEN;

import android.annotation.AnyThread;
import android.app.ActivityManager;
@@ -115,10 +116,17 @@ public class DozeSensors {
                new PluginSensor(
                        new SensorManagerPlugin.Sensor(TYPE_WAKE_DISPLAY),
                        Settings.Secure.DOZE_WAKE_SCREEN_GESTURE,
                        true /* configured */,
                        mConfig.wakeScreenGestureAvailable(),
                        DozeLog.REASON_SENSOR_WAKE_UP,
                        false /* reports touch coordinates */,
                        false /* touchscreen */),
                new PluginSensor(
                        new SensorManagerPlugin.Sensor(TYPE_WAKE_LOCK_SCREEN),
                        Settings.Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE,
                        mConfig.wakeScreenGestureAvailable(),
                        DozeLog.PULSE_REASON_SENSOR_WAKE_LOCK_SCREEN,
                        false /* reports touch coordinates */,
                        false /* touchscreen */),
        };

        mProxSensor = new ProxSensor(policy);
Loading