From 007f0e8f207d3d6d2f47d725b72459edf317cce9 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Fri, 14 Aug 2015 13:56:01 -0700 Subject: Fix race condition for doze mode and wake-and-unlocking When pulse was about to turn on and at the same time we were starting a wake-and-unlock sequence, there was jank because the scrim handling was not correct anymore. Now, abort the pulse when we are wake-and- unlocking so we don't see flickering with the scrims anymore. Bug: 23217476 Change-Id: I331f513b68fb1832b4372d3e2e518b31b556a43c --- packages/SystemUI/src/com/android/systemui/doze/DozeHost.java | 1 + packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 3 +++ 2 files changed, 4 insertions(+) (limited to 'packages/SystemUI/src/com/android/systemui/doze') diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java index 89a2c74..82a1bfe 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java @@ -29,6 +29,7 @@ public interface DozeHost { void stopDozing(); boolean isPowerSaveActive(); boolean isNotificationLightOn(); + boolean isPulsingBlocked(); public interface Callback { void onNewNotifications(); diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 887391c..a60b4e7 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -255,6 +255,9 @@ public class DozeService extends DreamService { } private void continuePulsing(int reason) { + if (mHost.isPulsingBlocked()) { + return; + } mHost.pulseWhileDozing(new DozeHost.PulseCallback() { @Override public void onPulseStarted() { -- cgit v1.1