summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/doze
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-11-20 21:48:09 -0500
committerJohn Spurlock <jspurlock@google.com>2014-11-20 21:59:13 -0500
commit686e4d57d8679ad4759ce872181294444a324638 (patch)
treeb8e4a999cacfbd1ee4d9a4c1aa464960a614bbce /packages/SystemUI/src/com/android/systemui/doze
parent83fb64e8ec4c6bc0930f50b24bd1c36a81f6a1c2 (diff)
downloadframeworks_base-686e4d57d8679ad4759ce872181294444a324638.zip
frameworks_base-686e4d57d8679ad4759ce872181294444a324638.tar.gz
frameworks_base-686e4d57d8679ad4759ce872181294444a324638.tar.bz2
Doze: Make proximity check configurable.
Default to true, but make it available for overlay or setting at runtime. Bug: 18373928 Change-Id: I6abc1924ea0f03620f4683dc055f64ede5782809
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/doze')
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeService.java44
1 files changed, 27 insertions, 17 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
index 8f14abb..89b3e5b 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
@@ -202,6 +202,12 @@ 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()) {
+ // skip proximity check
+ continuePulsing();
+ return;
+ }
+ // perform a proximity check before pulsing
final long start = SystemClock.uptimeMillis();
new ProximityCheck() {
@Override
@@ -216,28 +222,32 @@ public class DozeService extends DreamService {
}
// not in-pocket, continue pulsing
- mHost.pulseWhileDozing(new DozeHost.PulseCallback() {
- @Override
- public void onPulseStarted() {
- if (mPulsing && mDreaming) {
- turnDisplayOn();
- }
- }
-
- @Override
- public void onPulseFinished() {
- if (mPulsing && mDreaming) {
- mPulsing = false;
- turnDisplayOff();
- }
- mWakeLock.release(); // needs to be unconditional to balance acquire
- }
- });
+ continuePulsing();
}
}.check();
}
}
+ private void continuePulsing() {
+ mHost.pulseWhileDozing(new DozeHost.PulseCallback() {
+ @Override
+ public void onPulseStarted() {
+ if (mPulsing && mDreaming) {
+ turnDisplayOn();
+ }
+ }
+
+ @Override
+ public void onPulseFinished() {
+ if (mPulsing && mDreaming) {
+ mPulsing = false;
+ turnDisplayOff();
+ }
+ mWakeLock.release(); // needs to be unconditional to balance acquire
+ }
+ });
+ }
+
private void turnDisplayOff() {
if (DEBUG) Log.d(mTag, "Display off");
setDozeScreenState(Display.STATE_OFF);