Merge remote-tracking branch 'origin/android_branch' into android_branch

This commit is contained in:
Eric House 2013-08-28 20:08:33 -07:00
commit e2f689765b
2 changed files with 4 additions and 3 deletions

View file

@ -60,13 +60,13 @@ public class GCMIntentService extends GCMBaseIntentService {
protected void onMessage( Context context, Intent intent )
{
DbgUtils.logf( "GCMIntentService.onMessage()" );
notifyRelayService( true );
String value;
boolean ignoreIt = XWPrefs.getGCMIgnored( this );
if ( ignoreIt ) {
DbgUtils.logf( "received GCM but ignoring it" );
} else {
notifyRelayService( true );
value = intent.getStringExtra( "checkUpdates" );
if ( null != value && Boolean.parseBoolean( value ) ) {
UpdateCheckReceiver.checkVersions( context, true );

View file

@ -308,6 +308,7 @@ public class RelayService extends XWService
long interval_millis = m_maxIntervalSeconds * 1000;
RelayReceiver.RestartTimer( this, interval_millis );
}
stopThreads();
super.onDestroy();
}
@ -1074,7 +1075,7 @@ public class RelayService extends XWService
private boolean shouldMaintainConnection()
{
boolean result = !s_gcmWorking;
boolean result = XWPrefs.getGCMIgnored( this ) || !s_gcmWorking;
if ( result ) {
long interval = Utils.getCurSeconds() - m_lastGamePacketReceived;
result = interval < MAX_KEEPALIVE_SECS;