diff options
author | John Spurlock <jspurlock@google.com> | 2014-11-10 09:41:41 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-11-10 09:46:14 -0500 |
commit | 78503734837062306099460a61eb36646099fedd (patch) | |
tree | 095d4e4a04dc2b46635c0a34a3dc0999e7e9fdf2 /packages/SystemUI/src/com/android/systemui/doze | |
parent | bc8365148f9493ba7e90a8369add31fb712fd9ab (diff) | |
download | frameworks_base-78503734837062306099460a61eb36646099fedd.zip frameworks_base-78503734837062306099460a61eb36646099fedd.tar.gz frameworks_base-78503734837062306099460a61eb36646099fedd.tar.bz2 |
Doze: Fix trigger sensor re-registration.
Bug: 17541271
Change-Id: I3f19f86165dd4e3677af5ed354e4fc120f9bb407
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/doze')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index f8c5e9c..8f14abb 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -449,10 +449,12 @@ public class DozeService extends DreamService { private void updateListener() { if (!mConfigured || mSensor == null) return; - if (mRequested && !mDisabled) { + if (mRequested && !mDisabled && !mRegistered) { mRegistered = mSensors.requestTriggerSensor(this, mSensor); + if (DEBUG) Log.d(mTag, "requestTriggerSensor " + mRegistered); } else if (mRegistered) { - mSensors.cancelTriggerSensor(this, mSensor); + final boolean rt = mSensors.cancelTriggerSensor(this, mSensor); + if (DEBUG) Log.d(mTag, "cancelTriggerSensor " + rt); mRegistered = false; } } @@ -483,7 +485,8 @@ public class DozeService extends DreamService { } requestPulse(); - setListening(true); // reregister, this sensor only fires once + mRegistered = false; + updateListener(); // reregister, this sensor only fires once // reset the notification pulse schedule, but only if we think we were not triggered // by a notification-related vibration |