diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-06-05 14:59:24 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-06-09 00:02:55 +0000 |
commit | 839697006511afa61ecd07747523180b513b9b70 (patch) | |
tree | 9293ba654019692abf1fb6e058a38cd5e79a4258 /packages/SystemUI/src/com/android/systemui/doze | |
parent | 196597b7c09fce62276099292bb0e3d0572fe4a5 (diff) | |
download | frameworks_base-839697006511afa61ecd07747523180b513b9b70.zip frameworks_base-839697006511afa61ecd07747523180b513b9b70.tar.gz frameworks_base-839697006511afa61ecd07747523180b513b9b70.tar.bz2 |
Only doze when not occluded
This fixes a bug where an activity could have been started on top of
the lockscreen while dozing already. In that case, we would execute a
pulse and reveal the fully colored activity that is occluding the
Keyguard
Bug: 19465785
Change-Id: I9533390e13f11424a20a107005d60050a460e333
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/doze')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeLog.java | 16 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeService.java | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java index 1f3a830..3f72125 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -82,11 +82,9 @@ public class DozeLog { sNotificationPulseStats.append(); } - public static void traceDozing(Context context, boolean dozing) { - if (!ENABLED) return; - sPulsing = false; + private static void init(Context context) { synchronized (DozeLog.class) { - if (dozing && sMessages == null) { + if (sMessages == null) { sTimes = new long[SIZE]; sMessages = new String[SIZE]; sSince = System.currentTimeMillis(); @@ -105,6 +103,12 @@ public class DozeLog { KeyguardUpdateMonitor.getInstance(context).registerCallback(sKeyguardCallback); } } + } + + public static void traceDozing(Context context, boolean dozing) { + if (!ENABLED) return; + sPulsing = false; + init(context); log("dozing " + dozing); } @@ -146,10 +150,12 @@ public class DozeLog { } } - public static void traceProximityResult(boolean near, long millis, int pulseReason) { + public static void traceProximityResult(Context context, boolean near, long millis, + int pulseReason) { if (!ENABLED) return; log("proximityResult reason=" + pulseReasonToString(pulseReason) + " near=" + near + " millis=" + millis); + init(context); sProxStats[pulseReason][near ? 0 : 1].append(); } diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index 8d27450..5d46712 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -235,7 +235,7 @@ public class DozeService extends DreamService { public void onProximityResult(int result) { final boolean isNear = result == RESULT_NEAR; final long end = SystemClock.uptimeMillis(); - DozeLog.traceProximityResult(isNear, end - start, reason); + DozeLog.traceProximityResult(mContext, isNear, end - start, reason); if (nonBlocking) { // we already continued return; |