log device ID even when it's not newly assigned

This commit is contained in:
Eric House 2012-10-25 06:24:19 -07:00
parent fcc4a0a5f9
commit f2684e5652
2 changed files with 12 additions and 1 deletions

View file

@ -64,7 +64,13 @@ public class GCMIntentService extends GCMBaseIntentService {
DbgUtils.logf( "registering..." );
GCMRegistrar.register( app, GCMConsts.SENDER_ID );
} else {
DbgUtils.logf("Already registered");
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 );
}
}

View file

@ -189,6 +189,11 @@ public class XWPrefs {
setPrefsString( context, R.string.key_gcm_regid, devID );
}
public static String getGCMDevID( Context context )
{
return getPrefsString( context, R.string.key_gcm_regid );
}
public static void clearGCMDevID( Context context )
{
clearPrefsKey( context, R.string.key_gcm_regid );