don't show "can't do GCM" Toast on Kindle Fire

This commit is contained in:
Eric House 2012-11-08 06:38:35 -08:00
parent 2df4199a77
commit 3b1f6a695f

View file

@ -73,27 +73,22 @@ public class GCMIntentService extends GCMBaseIntentService {
public static void init( Application app )
{
DbgUtils.logf( "GCMIntentService.init()" );
int sdkVersion = Integer.valueOf(android.os.Build.VERSION.SDK);
int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK );
if ( 8 <= sdkVersion ) {
try {
GCMRegistrar.checkDevice( app );
GCMRegistrar.checkManifest( app );
// GCMRegistrar.checkManifest( app );
final String regId = GCMRegistrar.getRegistrationId( app );
if (regId.equals("")) {
DbgUtils.logf( "registering..." );
GCMRegistrar.register( app, GCMConsts.SENDER_ID );
} else {
DbgUtils.logf( "Already registered: id=\"%s\"", regId );
}
String curID = XWPrefs.getGCMDevID( app );
if ( ! curID.equals( regId ) ) {
DbgUtils.logf( "saved bad id: %s", curID );
XWPrefs.setGCMDevID( app, regId );
}
} catch ( UnsupportedOperationException uoe ) {
DbgUtils.showf( app, "Device can't do GCM; am I on an emulator?" );
DbgUtils.logf( "Device can't do GCM." );
}
}
}