From 6a04cb1efc4a6cfd6733d92c0c7efca5f9082e5d Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Mon, 14 Mar 2016 20:21:02 -0700 Subject: [PATCH] Prevent Log.wtf crash in benign case Fixes a crash that happens when you turn of the screen while moving the finger. Some touches still come in even when the screen went to sleep. No need to get upset over those. Bug: 27595423 Change-Id: If75ae3b6c2c83a87f38daaf8777f89d8c74a9cd1 --- .../src/com/android/systemui/classifier/FalsingManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java index 937f7d3194322..0d822cba1070a 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java @@ -166,7 +166,9 @@ public class FalsingManager implements SensorEventListener { */ public boolean isFalseTouch() { if (FalsingLog.ENABLED) { - if (!mSessionActive) { + // We're getting some false wtfs from touches that happen after the device went + // to sleep. Only report missing sessions that happen when the device is interactive. + if (!mSessionActive && mContext.getSystemService(PowerManager.class).isInteractive()) { FalsingLog.wtf("isFalseTouch", new StringBuilder() .append("Session is not active, yet there's a query for a false touch.") .append(" enabled=").append(isEnabled() ? 1 : 0)