michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.sync.receivers; michael@0: michael@0: import org.mozilla.gecko.background.common.log.Logger; michael@0: michael@0: import android.content.BroadcastReceiver; michael@0: import android.content.Context; michael@0: import android.content.Intent; michael@0: michael@0: public class SyncAccountDeletedReceiver extends BroadcastReceiver { michael@0: public static final String LOG_TAG = "SyncAccountDeletedReceiver"; michael@0: michael@0: /** michael@0: * This receiver can be killed as soon as it returns, but we have things to do michael@0: * that can't be done on the main thread (network activity). Therefore we michael@0: * start a service to do our clean up work for us, with Android doing the michael@0: * heavy lifting for the service's lifecycle. michael@0: *
michael@0: * See the Android documentation michael@0: * for details. michael@0: */ michael@0: @Override michael@0: public void onReceive(final Context context, Intent broadcastIntent) { michael@0: Logger.debug(LOG_TAG, "Sync Account Deleted broadcast received."); michael@0: michael@0: Intent serviceIntent = new Intent(context, SyncAccountDeletedService.class); michael@0: serviceIntent.putExtras(broadcastIntent); michael@0: context.startService(serviceIntent); michael@0: } michael@0: }