From 0bea58b128829630fe7aef84ec963403d8a578b1 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 22 Nov 2012 08:13:06 -0800 Subject: [PATCH] make it possible to build without knowing the GCM sender ID. --- xwords4/android/XWords4/build.xml | 1 + .../src/org/eehouse/android/xw4/GCMIntentService.java | 2 +- xwords4/android/scripts/gen_gcmid.sh | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/build.xml b/xwords4/android/XWords4/build.xml index b1d8ad988..d1536010c 100644 --- a/xwords4/android/XWords4/build.xml +++ b/xwords4/android/XWords4/build.xml @@ -61,6 +61,7 @@ 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 2ab40f4bc..1fc22e503 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java @@ -74,7 +74,7 @@ public class GCMIntentService extends GCMBaseIntentService { public static void init( Application app ) { int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK ); - if ( 8 <= sdkVersion ) { + if ( 8 <= sdkVersion && 0 < GCMConsts.SENDER_ID.length() ) { try { GCMRegistrar.checkDevice( app ); // GCMRegistrar.checkManifest( app ); diff --git a/xwords4/android/scripts/gen_gcmid.sh b/xwords4/android/scripts/gen_gcmid.sh index 9ca58833a..75bbb2089 100755 --- a/xwords4/android/scripts/gen_gcmid.sh +++ b/xwords4/android/scripts/gen_gcmid.sh @@ -1,8 +1,9 @@ #!/bin/sh +set -e -u + if [ -z "$GCM_SENDER_ID" ]; then - echo "GCM_SENDER_ID not in env" - exit 1 + echo "GCM_SENDER_ID empty; GCM use will be disabled" >&2 fi cat <