remove some logging

This commit is contained in:
Eric House 2022-04-24 23:02:33 -07:00
parent cc32ff451c
commit c21307c5b1

View file

@ -42,6 +42,7 @@ import java.util.TreeMap;
public class TimerReceiver extends BroadcastReceiver { public class TimerReceiver extends BroadcastReceiver {
private static final String TAG = TimerReceiver.class.getSimpleName(); private static final String TAG = TimerReceiver.class.getSimpleName();
private static final boolean VERBOSE = false;
private static final String DATA_KEY = TAG + "/data"; private static final String DATA_KEY = TAG + "/data";
private static final String KEY_FIREWHEN = "FIREWHEN"; private static final String KEY_FIREWHEN = "FIREWHEN";
private static final String KEY_BACKOFF = "BACKOFF"; private static final String KEY_BACKOFF = "BACKOFF";
@ -394,8 +395,10 @@ public class TimerReceiver extends BroadcastReceiver {
setJobTimerIf( context, delayMS, timerID ); setJobTimerIf( context, delayMS, timerID );
if ( VERBOSE ) {
Log.d( TAG, "setNextTimer(): SET id %d for %s at %s", timerID, Log.d( TAG, "setNextTimer(): SET id %d for %s at %s", timerID,
getSimpleName(firstClient), fmtLong(firstFireTime) ); getSimpleName(firstClient), fmtLong(firstFireTime) );
}
// } else { // } else {
// Assert.assertTrueNR( 0 != curNextFire ); // Assert.assertTrueNR( 0 != curNextFire );
// long diff = Math.abs( firstFireTime - curNextFire ); // long diff = Math.abs( firstFireTime - curNextFire );
@ -422,8 +425,10 @@ public class TimerReceiver extends BroadcastReceiver {
long nextFire = data.getFor( client, KEY_FIREWHEN, 0 ); long nextFire = data.getFor( client, KEY_FIREWHEN, 0 );
force = 0 == nextFire || backoff != curBackoff; force = 0 == nextFire || backoff != curBackoff;
} }
if ( VERBOSE ) {
Log.d( TAG, "setTimer(clazz=%s, force=%b, curBackoff=%d)", Log.d( TAG, "setTimer(clazz=%s, force=%b, curBackoff=%d)",
getSimpleName(client), force, backoff ); getSimpleName(client), force, backoff );
}
if ( force ) { if ( force ) {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
long fireMillis = now + backoff; long fireMillis = now + backoff;
@ -489,7 +494,9 @@ public class TimerReceiver extends BroadcastReceiver {
if ( null == data ) { if ( null == data ) {
try { try {
data = (Data)DBUtils.getSerializableFor( context, DATA_KEY ); data = (Data)DBUtils.getSerializableFor( context, DATA_KEY );
if ( VERBOSE ) {
Log.d( TAG, "load(): loaded: %s", toString(data) ); Log.d( TAG, "load(): loaded: %s", toString(data) );
}
} catch ( Exception ex ) { } catch ( Exception ex ) {
data = null; data = null;
} }
@ -507,6 +514,8 @@ public class TimerReceiver extends BroadcastReceiver {
private static void store( Context context, Data data ) private static void store( Context context, Data data )
{ {
DBUtils.setSerializableFor( context, DATA_KEY, data ); DBUtils.setSerializableFor( context, DATA_KEY, data );
if ( VERBOSE ) {
Log.d( TAG, "store(): saved: %s", toString(data) ); Log.d( TAG, "store(): saved: %s", toString(data) );
} }
} }
}