From 63407ce5b576d61de252bf0b030509076c33cee7 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 14 Jun 2019 16:32:32 -0700 Subject: [PATCH] wip: don't print stats header without stats --- .../java/org/eehouse/android/xw4/ConnStatusHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java index a40ee43d0..f1c028441 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java @@ -239,7 +239,7 @@ public class ConnStatusHandler { private static HashMap sStallStatsMap; - static StallStats get( Context context, CommsConnType typ ) + static StallStats get( Context context, CommsConnType typ, boolean makeNew ) { if ( null == sStallStatsMap ) { sStallStatsMap = (HashMap)DBUtils @@ -250,7 +250,7 @@ public class ConnStatusHandler { } StallStats result = sStallStatsMap.get( typ ); - if ( result == null ) { + if ( result == null && makeNew ) { result = new StallStats(); sStallStatsMap.put( typ, result ); } @@ -316,7 +316,7 @@ public class ConnStatusHandler { { // long[] nums = StallStats.get( context, typ ).averages(); // return "Average for last 10 Intents (spanning %s): %dms";; - StallStats stats = StallStats.get( context, typ ); + StallStats stats = StallStats.get( context, typ, false ); return stats == null ? null : stats.toString( context ); } @@ -396,7 +396,7 @@ public class ConnStatusHandler { long ageMS ) { // Log.d( TAG, "noteIntentHandled(%s, ageMS=%d)", connType, ageMS ); - StallStats.get( context, connType ).append( context, ageMS ); + StallStats.get( context, connType, true ).append( context, ageMS ); } public static void draw( Context context, Canvas canvas, Resources res,