1c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly/*
2c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * Copyright (C) 2011 The Android Open Source Project
3c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
4c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * Licensed under the Apache License, Version 2.0 (the "License");
5c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * you may not use this file except in compliance with the License.
6c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * You may obtain a copy of the License at
7c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
8c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *      http://www.apache.org/licenses/LICENSE-2.0
9c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
10c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * Unless required by applicable law or agreed to in writing, software
11c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * distributed under the License is distributed on an "AS IS" BASIS,
12c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * See the License for the specific language governing permissions and
14c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * limitations under the License.
15c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly */
16c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly
17c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pellypackage android.nfc;
18c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly
19c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly/**
20c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * Wraps information associated with any NFC event.
21c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
22c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * <p>Immutable object, with direct access to the (final) fields.
23c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
24c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * <p>An {@link NfcEvent} object is usually included in callbacks from
25c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * {@link NfcAdapter}. Check the documentation of the callback to see
26c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * which fields may be set.
27c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
28c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * <p>This wrapper object is used (instead of parameters
29c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * in the callback) because it allows new fields to be added without breaking
30c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly * API compatibility.
31c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly *
322d68a6ba3c1354f363e5ee77448f163664bf47d9Scott Main * @see NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete
332d68a6ba3c1354f363e5ee77448f163664bf47d9Scott Main * @see NfcAdapter.CreateNdefMessageCallback#createNdefMessage
34c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly */
35c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pellypublic final class NfcEvent {
36c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly    /**
37c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly     * The {@link NfcAdapter} associated with the NFC event.
38c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly     */
39c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly    public final NfcAdapter nfcAdapter;
40c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly
41c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly    NfcEvent(NfcAdapter nfcAdapter) {
42c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly        this.nfcAdapter = nfcAdapter;
43c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly    }
44c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9Nick Pelly}
45