mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
add some logging around RelayService lifecycle
This commit is contained in:
parent
7fba555d33
commit
5d36470e50
2 changed files with 36 additions and 0 deletions
|
@ -28,10 +28,12 @@ import android.content.Intent;
|
|||
import android.os.SystemClock;
|
||||
|
||||
public class RelayReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = RelayReceiver.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent )
|
||||
{
|
||||
Log.d( TAG, "onReceive(intent=%s)", intent );
|
||||
RelayService.timerFired( context );
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.JobIntentService;
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
@ -205,6 +206,7 @@ public class RelayService extends JobIntentService
|
|||
Log.d( TAG, "calling enqueueWork(id=%d, cmd=%s)", sJobID,
|
||||
cmdFrom( intent ) );
|
||||
enqueueWork( context, RelayService.class, sJobID, intent );
|
||||
Log.d( TAG, "enqueueWork() returned" );
|
||||
}
|
||||
|
||||
private static MsgCmds cmdFrom( Intent intent )
|
||||
|
@ -375,11 +377,13 @@ public class RelayService extends JobIntentService
|
|||
Log.d( TAG, "%s.onHandleWork(cmd=%s)", this, cmdFrom( intent ) );
|
||||
handleCommand( intent );
|
||||
resetExitTimer();
|
||||
Log.d( TAG, "%s.onHandleWork(cmd=%s) DONE", this, cmdFrom( intent ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
Log.d( TAG, "onDestroy() called" );
|
||||
if ( shouldMaintainConnection() ) {
|
||||
long interval_millis = getMaxIntervalSeconds() * 1000;
|
||||
RelayReceiver.setTimer( this, interval_millis );
|
||||
|
@ -391,6 +395,36 @@ public class RelayService extends JobIntentService
|
|||
Log.d( TAG, "%s.onDestroy() DONE", this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStopCurrentWork() {
|
||||
Log.d( TAG, "onStopCurrentWork() called");
|
||||
boolean result = super.onStopCurrentWork();
|
||||
Log.d( TAG, "onStopCurrentWork() => %b", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTaskRemoved(Intent rootIntent) {
|
||||
Log.d( TAG, "onTaskRemoved() called");
|
||||
super.onTaskRemoved(rootIntent);
|
||||
Log.d( TAG, "onTaskRemoved() => (void)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
|
||||
Log.d( TAG, "onStartCommand(%s) called", intent );
|
||||
int result = super.onStartCommand(intent, flags, startId );
|
||||
Log.d( TAG, "onStartCommand() => %d", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
Log.d( TAG, "onLowMemory() called" );
|
||||
super.onLowMemory();
|
||||
Log.d( TAG, "onLowMemory() => void" );
|
||||
}
|
||||
|
||||
// NetStateCache.StateChangedIf interface
|
||||
@Override
|
||||
public void onNetAvail( boolean nowAvailable )
|
||||
|
|
Loading…
Reference in a new issue