diff options
author | John Spurlock <jspurlock@google.com> | 2014-12-03 16:00:44 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-12-03 16:04:28 -0500 |
commit | 621afac810e83e13a131c6f8db2658edd0347208 (patch) | |
tree | deac10b2f6f7e54db43a3c2611347e19f815c40f /packages/SystemUI/src/com/android/systemui/doze | |
parent | cdf7f984870344de1b1237e2a7749a3e32b2b688 (diff) | |
download | frameworks_base-621afac810e83e13a131c6f8db2658edd0347208.zip frameworks_base-621afac810e83e13a131c6f8db2658edd0347208.tar.gz frameworks_base-621afac810e83e13a131c6f8db2658edd0347208.tar.bz2 |
Doze: Don't block pickup pulses on a proximity check.
Pulse immediately, assuming the pickup sensor will not fire
if prox=near. Perform a non-blocking additional proximity check
in these cases purely to collect verification diagnostics.
Also tweak the interpolator for pickup pulses to ramp up more
quickly.
Bug: 18373928
Change-Id: I8607f4b37435722e293db741c273914183cec7be
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/doze')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 36995ff..8d27450 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -217,22 +217,30 @@ public class DozeService extends DreamService { // Here we need a wakelock to stay awake until the pulse is finished. mWakeLock.acquire(); mPulsing = true; - if (!mDozeParameters.getProxCheckBeforePulse() || - reason == DozeLog.PULSE_REASON_SENSOR_PICKUP - && mDozeParameters.getPickupPerformsProxCheck()) { + if (!mDozeParameters.getProxCheckBeforePulse()) { // skip proximity check continuePulsing(reason); return; } - // perform a proximity check before pulsing final long start = SystemClock.uptimeMillis(); + final boolean nonBlocking = reason == DozeLog.PULSE_REASON_SENSOR_PICKUP + && mDozeParameters.getPickupPerformsProxCheck(); + if (nonBlocking) { + // proximity check is only done to capture statistics, continue pulsing + continuePulsing(reason); + } + // perform a proximity check new ProximityCheck() { @Override public void onProximityResult(int result) { - // avoid pulsing in pockets final boolean isNear = result == RESULT_NEAR; final long end = SystemClock.uptimeMillis(); DozeLog.traceProximityResult(isNear, end - start, reason); + if (nonBlocking) { + // we already continued + return; + } + // avoid pulsing in pockets if (isNear) { mPulsing = false; mWakeLock.release(); |