From 1e13d6ac6c897c956953afba6a158e7f6fae57f1 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 6 Nov 2012 19:09:15 -0800 Subject: [PATCH] look for values in msg sent from server, including one that puts up a message via a notification. --- .../eehouse/android/xw4/GCMIntentService.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java index c820799aa..682b90c67 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java @@ -52,7 +52,23 @@ public class GCMIntentService extends GCMBaseIntentService { protected void onMessage( Context context, Intent intent ) { DbgUtils.logf( "GCMIntentService.onMessage(%s)", intent.toString() ); - RelayReceiver.RestartTimer( context, true ); + boolean doRestartTimer = true; // keep a few days... + String value = intent.getStringExtra( "msg" ); + if ( null != value ) { + doRestartTimer = false; // expected key means new format + + String title = intent.getStringExtra( "title" ); + Utils.postNotification( context, null, title, value, 100000 ); + } + + value = intent.getStringExtra( "getMoves" ); + if ( null != value && Boolean.parseBoolean( value ) ) { + doRestartTimer = true; + } + + if ( doRestartTimer ) { + RelayReceiver.RestartTimer( context, true ); + } } public static void init( Application app )