mobile/android/base/sync/receivers/SyncAccountDeletedReceiver.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.sync.receivers;
     7 import org.mozilla.gecko.background.common.log.Logger;
     9 import android.content.BroadcastReceiver;
    10 import android.content.Context;
    11 import android.content.Intent;
    13 public class SyncAccountDeletedReceiver extends BroadcastReceiver {
    14   public static final String LOG_TAG = "SyncAccountDeletedReceiver";
    16   /**
    17    * This receiver can be killed as soon as it returns, but we have things to do
    18    * that can't be done on the main thread (network activity). Therefore we
    19    * start a service to do our clean up work for us, with Android doing the
    20    * heavy lifting for the service's lifecycle.
    21    * <p>
    22    * See <a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html#ReceiverLifecycle">the Android documentation</a>
    23    * for details.
    24    */
    25   @Override
    26   public void onReceive(final Context context, Intent broadcastIntent) {
    27     Logger.debug(LOG_TAG, "Sync Account Deleted broadcast received.");
    29     Intent serviceIntent = new Intent(context, SyncAccountDeletedService.class);
    30     serviceIntent.putExtras(broadcastIntent);
    31     context.startService(serviceIntent);
    32   }
    33 }

mercurial