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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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