mobile/android/base/webapp/TaskKiller.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 package org.mozilla.gecko.webapp;
     8 import android.content.BroadcastReceiver;
     9 import android.content.Context;
    10 import android.content.Intent;
    11 import android.util.Log;
    13 /**
    14  * This BroadcastReceiver is registered in the AndroidManifest.xml.in file.
    15  *
    16  * <p>It listens for intents sent by synthesized APKs when the task has been ended.
    17  * e.g. when the user has swiped it out of the Recent Apps List.</p>
    18  *
    19  */
    20 public class TaskKiller extends BroadcastReceiver {
    22     private static final String LOGTAG = "GeckoWebappTaskKiller";
    24     @Override
    25     public void onReceive(Context context, Intent intent) {
    26         String packageName = intent.getStringExtra("packageName");
    27         int slot = Allocator.getInstance(context).getIndexForApp(packageName);
    28         if (slot >= 0) {
    29             EventListener.killWebappSlot(context, slot);
    30         } else {
    31             Log.w(LOGTAG, "Asked to kill " + packageName + " but this runtime (" + context.getPackageName() + ") doesn't know about it.");
    32         }
    33     }
    35 }

mercurial