From bee3b0a023eac88922b51d4940537c5d0332f6fc Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Mon, 29 Sep 2014 11:30:12 -0400 Subject: DozeLog: Keep keyguard monitor alive, keep emer call stats. Ensure the existing keyguard callback survives weak reference collection, and add missing emergency call stats append. Bug:17496795 Change-Id: Iecec4646562cf1f6edb5bc5972767127f4419035 --- .../src/com/android/systemui/doze/DozeLog.java | 53 ++++++++++++---------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'packages') diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java index 3bf86a0..34bbc2e 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -89,29 +89,7 @@ public class DozeLog { sScreenOnNotPulsingStats = new SummaryStats(); sEmergencyCallStats = new SummaryStats(); log("init"); - KeyguardUpdateMonitor.getInstance(context) - .registerCallback(new KeyguardUpdateMonitorCallback() { - @Override - public void onEmergencyCallAction() { - traceEmergencyCall(); - } - @Override - public void onKeyguardBouncerChanged(boolean bouncer) { - traceKeyguardBouncerChanged(bouncer); - } - @Override - public void onScreenTurnedOn() { - traceScreenOn(); - } - @Override - public void onScreenTurnedOff(int why) { - traceScreenOff(why); - } - @Override - public void onKeyguardVisibilityChanged(boolean showing) { - traceKeyguard(showing); - } - }); + KeyguardUpdateMonitor.getInstance(context).registerCallback(sKeyguardCallback); } } log("dozing " + dozing); @@ -126,6 +104,7 @@ public class DozeLog { public static void traceEmergencyCall() { if (!ENABLED) return; log("emergencyCall"); + sEmergencyCallStats.append(); } public static void traceKeyguardBouncerChanged(boolean showing) { @@ -208,4 +187,32 @@ public class DozeLog { pw.println(); } } + + private static final KeyguardUpdateMonitorCallback sKeyguardCallback = + new KeyguardUpdateMonitorCallback() { + @Override + public void onEmergencyCallAction() { + traceEmergencyCall(); + } + + @Override + public void onKeyguardBouncerChanged(boolean bouncer) { + traceKeyguardBouncerChanged(bouncer); + } + + @Override + public void onScreenTurnedOn() { + traceScreenOn(); + } + + @Override + public void onScreenTurnedOff(int why) { + traceScreenOff(why); + } + + @Override + public void onKeyguardVisibilityChanged(boolean showing) { + traceKeyguard(showing); + } + }; } -- cgit v1.1