mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
cleanup: remove logging and only check for messages when the json data
holds that command.
This commit is contained in:
parent
5cbafb9f56
commit
07123ac823
1 changed files with 5 additions and 11 deletions
|
@ -37,12 +37,11 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
@Override
|
@Override
|
||||||
protected void onRegistered( Context context, String regId )
|
protected void onRegistered( Context context, String regId )
|
||||||
{
|
{
|
||||||
DbgUtils.logf("GCMIntentService.onRegistered(%s)", regId );
|
|
||||||
XWPrefs.setGCMDevID( context, regId );
|
XWPrefs.setGCMDevID( context, regId );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onUnregistered( Context context, String regId )
|
protected void onUnregistered( Context context, String regId )
|
||||||
{
|
{
|
||||||
DbgUtils.logf( "GCMIntentService.onUnregistered(%s)", regId );
|
DbgUtils.logf( "GCMIntentService.onUnregistered(%s)", regId );
|
||||||
XWPrefs.clearGCMDevID( context );
|
XWPrefs.clearGCMDevID( context );
|
||||||
|
@ -51,22 +50,17 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
@Override
|
@Override
|
||||||
protected void onMessage( Context context, Intent intent )
|
protected void onMessage( Context context, Intent intent )
|
||||||
{
|
{
|
||||||
DbgUtils.logf( "GCMIntentService.onMessage(%s)", intent.toString() );
|
|
||||||
boolean doRestartTimer = true; // keep a few days...
|
|
||||||
String value = intent.getStringExtra( "msg" );
|
String value = intent.getStringExtra( "msg" );
|
||||||
if ( null != value ) {
|
if ( null != value ) {
|
||||||
doRestartTimer = false; // expected key means new format
|
|
||||||
|
|
||||||
String title = intent.getStringExtra( "title" );
|
String title = intent.getStringExtra( "title" );
|
||||||
Utils.postNotification( context, null, title, value, 100000 );
|
if ( null != title ) {
|
||||||
|
int code = value.hashCode() ^ title.hashCode();
|
||||||
|
Utils.postNotification( context, null, title, value, code );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value = intent.getStringExtra( "getMoves" );
|
value = intent.getStringExtra( "getMoves" );
|
||||||
if ( null != value && Boolean.parseBoolean( value ) ) {
|
if ( null != value && Boolean.parseBoolean( value ) ) {
|
||||||
doRestartTimer = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( doRestartTimer ) {
|
|
||||||
RelayReceiver.RestartTimer( context, true );
|
RelayReceiver.RestartTimer( context, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue