mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +01:00
improve gcm-debug toast message
This commit is contained in:
parent
e378647e36
commit
0da5d9dd28
1 changed files with 8 additions and 9 deletions
|
@ -69,15 +69,13 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
{
|
{
|
||||||
Log.d( TAG, "onMessage()" );
|
Log.d( TAG, "onMessage()" );
|
||||||
|
|
||||||
if ( null == m_toastGCM ) {
|
|
||||||
m_toastGCM = new Boolean( XWPrefs.getToastGCM( context ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( XWPrefs.getIgnoreGCM( context ) ) {
|
if ( XWPrefs.getIgnoreGCM( context ) ) {
|
||||||
String logMsg = "received GCM but ignoring it";
|
String logMsg = "received GCM but ignoring it";
|
||||||
Log.d( TAG, logMsg );
|
Log.d( TAG, logMsg );
|
||||||
DbgUtils.showf( context, logMsg );
|
DbgUtils.showf( context, logMsg );
|
||||||
} else {
|
} else {
|
||||||
|
boolean toastGCM = XWPrefs.getToastGCM( context );
|
||||||
|
|
||||||
notifyRelayService( context, true );
|
notifyRelayService( context, true );
|
||||||
|
|
||||||
String value = intent.getStringExtra( "checkUpdates" );
|
String value = intent.getStringExtra( "checkUpdates" );
|
||||||
|
@ -88,8 +86,9 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
value = intent.getStringExtra( "getMoves" );
|
value = intent.getStringExtra( "getMoves" );
|
||||||
if ( null != value && Boolean.parseBoolean( value ) ) {
|
if ( null != value && Boolean.parseBoolean( value ) ) {
|
||||||
RelayService.timerFired( context );
|
RelayService.timerFired( context );
|
||||||
if ( m_toastGCM ) {
|
if ( toastGCM ) {
|
||||||
DbgUtils.showf( context, "onMessage(): got 'getMoves'" );
|
DbgUtils.showf( context, "%s.onMessage(): got 'getMoves'",
|
||||||
|
TAG );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,9 +98,9 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
try {
|
try {
|
||||||
JSONArray msgs64 = new JSONArray( value );
|
JSONArray msgs64 = new JSONArray( value );
|
||||||
String[] strs64 = new String[msgs64.length()];
|
String[] strs64 = new String[msgs64.length()];
|
||||||
if ( m_toastGCM ) {
|
if ( toastGCM ) {
|
||||||
DbgUtils.showf( context, "onMessage(): got %d msgs",
|
DbgUtils.showf( context, "%s.onMessage(): got %d msgs",
|
||||||
strs64.length );
|
TAG, strs64.length );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int ii = 0; ii < strs64.length; ++ii ) {
|
for ( int ii = 0; ii < strs64.length; ++ii ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue