Doze: Aggressively dial down notification-related pulses.

When dozing and buzz-worthy notifications arrive, don't follow
the LED logic with periodic pulses.

Instead, follow a simple decay schedule after the initial arrival,
 pulsing only at 10s, 30s, 60s, and 120s.

The schedule is reset when a new notification arrives, but only
for the first three times, until either the pickup sensor is
triggered or the device exits doze.

Also:
 - Make the notification trigger configurable.
 - Centralize existing sysprop configuration into DozeParameters.
 - Decouple vibration from debugging, make separately configurable.
 - Remove "delayed" pulse concept, fold into new schedule.

Bug:17496795
Change-Id: I64fc1c862bcfa1c288a4fd91c9d17e3bff245add
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 57e5755..3ff11d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -129,20 +129,20 @@
         if (!mDozing) {
             cancelPulsing();
             mAnimateChange = true;
+        } else {
+            mAnimateChange = false;
         }
         scheduleUpdate();
     }
 
     /** When dozing, fade screen contents in and out using the front scrim. */
-    public long pulse(boolean delayed) {
+    public long pulse() {
         if (!mDozing) return 0;
         final long now = System.currentTimeMillis();
-        if (DEBUG) Log.d(TAG, "pulse delayed=" + delayed + " mPulseEndTime=" + mPulseEndTime
-                + " now=" + now);
+        if (DEBUG) Log.d(TAG, "pulse mPulseEndTime=" + mPulseEndTime + " now=" + now);
         if (mPulseEndTime != 0 && mPulseEndTime > now) return mPulseEndTime - now;
-        final long delay = delayed ? mDozeParameters.getPulseStartDelay() : 0;
-        mScrimInFront.postDelayed(mPulseIn, delay);
-        mPulseEndTime = now + delay + mDozeParameters.getPulseDuration();
+        mScrimInFront.post(mPulseIn);
+        mPulseEndTime = now + mDozeParameters.getPulseDuration();
         return mPulseEndTime - now;
     }