OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.nfc; |
| 6 |
| 7 import android.content.Context; |
| 8 import android.content.Intent; |
| 9 import android.nfc.NfcAdapter; |
| 10 import android.support.v4.content.LocalBroadcastManager; |
| 11 |
| 12 /** |
| 13 * When NFC mojo service enables foreground dispatch for NFC adapter, chrome |
| 14 * can receive intent that contains NfcAdapter.EXTRA_TAG. Forward such Intents |
| 15 * to NFC mojo service. |
| 16 */ |
| 17 public final class NfcIntentHandler { |
| 18 public static boolean handleIntent(final Context context, final Intent inten
t) { |
| 19 if (!intent.hasExtra(NfcAdapter.EXTRA_TAG)) return false; |
| 20 LocalBroadcastManager manager = LocalBroadcastManager.getInstance(contex
t); |
| 21 return manager.sendBroadcast(intent); |
| 22 } |
| 23 } |
OLD | NEW |