package edu.berkeley.eecs.cfc_tracker;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/*
 * Class that allows us to re-register the alarms when the phone is rebooted.
 */
public class BootReceiver extends BroadcastReceiver {

    private static final int BOOT_RECEIVER_ID = 1111;

    @Override
	public void onReceive(Context ctx, Intent intent) {
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
        	System.out.println("BootReceiver.onReceive called");

            /*
             * End any ongoing trips, because the elapsed time will get reset at this
             * point and invalidate all entries in the database.
             * TODO: Remove this if we decide to switch back to utc time.
             */
            // DataUtils.endTrip(ctx);

            // Re-initialize the state machine
            ctx.sendBroadcast(new Intent(ctx.getString(R.string.transition_initialize)));
        }
	}
}

@@ -139,16 +139,185 @@
 ntent;%0A%0A
+import edu.berkeley.eecs.cfc_tracker.log.Log;%0Aimport edu.berkeley.eecs.cfc_tracker.usercache.UserCacheFactory;%0Aimport edu.berkeley.eecs.cfc_tracker.wrapper.Transition;%0A%0A
 /*%0A * Cl
@@ -447,17 +447,64 @@
 eiver %7B%0A
+    private static String TAG = %22BootReceiver%22;
 %0A
-
     priv
@@ -694,24 +694,24 @@
 PLETED%22)) %7B%0A
-
         %09Sys
@@ -759,16 +759,295 @@
 alled%22);
+%0A            Log.i(ctx, TAG, %22BootReceiver.onReceive called%22);%0A            // TODO: Use a different wrapper? Or a different key?%0A            UserCacheFactory.getUserCache(ctx).putMessage(R.string.key_usercache_transition,%0A                    new Transition(%22unknown%22, %22booted%22));
 %0A%0A      

Add some additional logging to the boot receiver