Loading packages/SystemUI/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -252,7 +252,7 @@ <integer name="doze_pickup_vibration_threshold">2000</integer> <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">false</bool> <bool name="doze_pickup_performs_proximity_check">true</bool> <!-- Doze: pulse parameter - how long does it take to fade in? --> <integer name="doze_pulse_duration_in">900</integer> Loading packages/SystemUI/src/com/android/systemui/doze/DozeService.java +13 −5 Original line number Diff line number Diff line Loading @@ -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(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java +7 −4 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class DozeScrimController { private final DozeParameters mDozeParameters; private final Interpolator mPulseInInterpolator = PhoneStatusBar.ALPHA_OUT; private final Interpolator mPulseInInterpolatorPickup; private final Interpolator mPulseOutInterpolator = PhoneStatusBar.ALPHA_IN; private final Interpolator mDozeAnimationInterpolator; private final Handler mHandler = new Handler(); Loading @@ -54,8 +55,8 @@ public class DozeScrimController { public DozeScrimController(ScrimController scrimController, Context context) { mScrimController = scrimController; mDozeParameters = new DozeParameters(context); mDozeAnimationInterpolator = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); mDozeAnimationInterpolator = mPulseInInterpolatorPickup = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); } public void setDozing(boolean dozing, boolean animate) { Loading Loading @@ -222,8 +223,10 @@ public class DozeScrimController { if (!mDozing) return; DozeLog.tracePulseStart(mPulseReason); final boolean pickup = mPulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP; startScrimAnimation(true /* inFront */, 0f, mDozeParameters.getPulseInDuration(pickup), mPulseInInterpolator, mDozeParameters.getPulseInDelay(pickup), startScrimAnimation(true /* inFront */, 0f, mDozeParameters.getPulseInDuration(pickup), pickup ? mPulseInInterpolatorPickup : mPulseInInterpolator, mDozeParameters.getPulseInDelay(pickup), mPulseInFinished); // Signal that the pulse is ready to turn the screen on and draw. Loading Loading
packages/SystemUI/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -252,7 +252,7 @@ <integer name="doze_pickup_vibration_threshold">2000</integer> <!-- Doze: can we assume the pickup sensor includes a proximity check? --> <bool name="doze_pickup_performs_proximity_check">false</bool> <bool name="doze_pickup_performs_proximity_check">true</bool> <!-- Doze: pulse parameter - how long does it take to fade in? --> <integer name="doze_pulse_duration_in">900</integer> Loading
packages/SystemUI/src/com/android/systemui/doze/DozeService.java +13 −5 Original line number Diff line number Diff line Loading @@ -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(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java +7 −4 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class DozeScrimController { private final DozeParameters mDozeParameters; private final Interpolator mPulseInInterpolator = PhoneStatusBar.ALPHA_OUT; private final Interpolator mPulseInInterpolatorPickup; private final Interpolator mPulseOutInterpolator = PhoneStatusBar.ALPHA_IN; private final Interpolator mDozeAnimationInterpolator; private final Handler mHandler = new Handler(); Loading @@ -54,8 +55,8 @@ public class DozeScrimController { public DozeScrimController(ScrimController scrimController, Context context) { mScrimController = scrimController; mDozeParameters = new DozeParameters(context); mDozeAnimationInterpolator = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); mDozeAnimationInterpolator = mPulseInInterpolatorPickup = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); } public void setDozing(boolean dozing, boolean animate) { Loading Loading @@ -222,8 +223,10 @@ public class DozeScrimController { if (!mDozing) return; DozeLog.tracePulseStart(mPulseReason); final boolean pickup = mPulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP; startScrimAnimation(true /* inFront */, 0f, mDozeParameters.getPulseInDuration(pickup), mPulseInInterpolator, mDozeParameters.getPulseInDelay(pickup), startScrimAnimation(true /* inFront */, 0f, mDozeParameters.getPulseInDuration(pickup), pickup ? mPulseInInterpolatorPickup : mPulseInInterpolator, mDozeParameters.getPulseInDelay(pickup), mPulseInFinished); // Signal that the pulse is ready to turn the screen on and draw. Loading