mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +01:00
log device ID even when it's not newly assigned
This commit is contained in:
parent
fcc4a0a5f9
commit
f2684e5652
2 changed files with 12 additions and 1 deletions
|
@ -64,7 +64,13 @@ public class GCMIntentService extends GCMBaseIntentService {
|
||||||
DbgUtils.logf( "registering..." );
|
DbgUtils.logf( "registering..." );
|
||||||
GCMRegistrar.register( app, GCMConsts.SENDER_ID );
|
GCMRegistrar.register( app, GCMConsts.SENDER_ID );
|
||||||
} else {
|
} 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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,6 +189,11 @@ public class XWPrefs {
|
||||||
setPrefsString( context, R.string.key_gcm_regid, devID );
|
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 )
|
public static void clearGCMDevID( Context context )
|
||||||
{
|
{
|
||||||
clearPrefsKey( context, R.string.key_gcm_regid );
|
clearPrefsKey( context, R.string.key_gcm_regid );
|
||||||
|
|
Loading…
Add table
Reference in a new issue