public static void setRegisteredOnServer ( Context context , boolean flag ) { final SharedPreferences prefs = getGCMPreferences ( context ) ; Editor editor = prefs . edit ( ) ; editor . putBoolean ( PROPERTY_ON_SERVER , flag ) ; // set the flag's expiration date long lifespan = getRegisterOnServerLifespan ( context ) ; long expirationTime = System . currentTimeMillis ( ) + lifespan ; Log . v ( TAG , "Setting registeredOnServer status as " + flag + " until " + new Timestamp ( expirationTime ) ) ; editor . putLong ( PROPERTY_ON_SERVER_EXPIRATION_TIME , expirationTime ) ; editor . commit ( ) ; }
Sets whether the device was successfully registered in the server side .