From 0da5d9dd2881e4811365ccd0ca129e942e2a0f3a Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 13 Jan 2019 21:56:59 -0800 Subject: [PATCH] improve gcm-debug toast message --- .../eehouse/android/xw4/GCMIntentService.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/xwords4/android/app/src/xw4/java/org/eehouse/android/xw4/GCMIntentService.java b/xwords4/android/app/src/xw4/java/org/eehouse/android/xw4/GCMIntentService.java index bc2f8e4f4..b5f75a606 100644 --- a/xwords4/android/app/src/xw4/java/org/eehouse/android/xw4/GCMIntentService.java +++ b/xwords4/android/app/src/xw4/java/org/eehouse/android/xw4/GCMIntentService.java @@ -69,15 +69,13 @@ public class GCMIntentService extends GCMBaseIntentService { { Log.d( TAG, "onMessage()" ); - if ( null == m_toastGCM ) { - m_toastGCM = new Boolean( XWPrefs.getToastGCM( context ) ); - } - if ( XWPrefs.getIgnoreGCM( context ) ) { String logMsg = "received GCM but ignoring it"; Log.d( TAG, logMsg ); DbgUtils.showf( context, logMsg ); } else { + boolean toastGCM = XWPrefs.getToastGCM( context ); + notifyRelayService( context, true ); String value = intent.getStringExtra( "checkUpdates" ); @@ -88,8 +86,9 @@ public class GCMIntentService extends GCMBaseIntentService { value = intent.getStringExtra( "getMoves" ); if ( null != value && Boolean.parseBoolean( value ) ) { RelayService.timerFired( context ); - if ( m_toastGCM ) { - DbgUtils.showf( context, "onMessage(): got 'getMoves'" ); + if ( toastGCM ) { + DbgUtils.showf( context, "%s.onMessage(): got 'getMoves'", + TAG ); } } @@ -99,9 +98,9 @@ public class GCMIntentService extends GCMBaseIntentService { try { JSONArray msgs64 = new JSONArray( value ); String[] strs64 = new String[msgs64.length()]; - if ( m_toastGCM ) { - DbgUtils.showf( context, "onMessage(): got %d msgs", - strs64.length ); + if ( toastGCM ) { + DbgUtils.showf( context, "%s.onMessage(): got %d msgs", + TAG, strs64.length ); } for ( int ii = 0; ii < strs64.length; ++ii ) {