Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ LOCAL_SRC_FILES += \ core/java/android/nfc/INfcAdapter.aidl \ core/java/android/nfc/INfcAdapterExtras.aidl \ core/java/android/nfc/INfcTag.aidl \ core/java/android/nfc/INfcCardEmulation.aidl \ core/java/android/os/IBatteryPropertiesListener.aidl \ core/java/android/os/IBatteryPropertiesRegistrar.aidl \ core/java/android/os/ICancellationSignal.aidl \ Loading api/current.txt +13 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ package android { field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET"; field public static final java.lang.String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN"; field public static final java.lang.String BIND_INPUT_METHOD = "android.permission.BIND_INPUT_METHOD"; field public static final java.lang.String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE"; field public static final java.lang.String BIND_NOTIFICATION_LISTENER_SERVICE = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"; field public static final java.lang.String BIND_PRINT_SERVICE = "android.permission.BIND_PRINT_SERVICE"; field public static final java.lang.String BIND_REMOTEVIEWS = "android.permission.BIND_REMOTEVIEWS"; Loading Loading @@ -14808,6 +14809,18 @@ package android.nfc { package android.nfc.cardemulation { public final class CardEmulationManager { method public static synchronized android.nfc.cardemulation.CardEmulationManager getInstance(android.nfc.NfcAdapter); method public boolean isDefaultServiceForAid(android.content.ComponentName, java.lang.String); method public boolean isDefaultServiceForCategory(android.content.ComponentName, java.lang.String); method public boolean setDefaultServiceForCategory(android.content.ComponentName, java.lang.String); field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.ACTION_CHANGE_DEFAULT"; field public static final java.lang.String CATEGORY_OTHER = "other"; field public static final java.lang.String CATEGORY_PAYMENT = "payment"; field public static final java.lang.String EXTRA_CATEGORY = "category"; field public static final java.lang.String EXTRA_SERVICE_COMPONENT = "component"; } public abstract class HostApduService extends android.app.Service { ctor public HostApduService(); method public final android.os.IBinder onBind(android.content.Intent); core/java/android/nfc/INfcAdapter.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.nfc.TechListParcel; import android.nfc.INdefPushCallback; import android.nfc.INfcAdapterExtras; import android.nfc.INfcTag; import android.nfc.INfcCardEmulation; /** * @hide Loading @@ -31,6 +32,7 @@ import android.nfc.INfcTag; interface INfcAdapter { INfcTag getNfcTagInterface(); INfcCardEmulation getNfcCardEmulationInterface(); INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg); int getState(); Loading core/java/android/nfc/INfcCardEmulation.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.nfc; import android.content.ComponentName; import android.nfc.cardemulation.ApduServiceInfo; import android.os.RemoteCallback; /** * @hide */ interface INfcCardEmulation { boolean isDefaultServiceForCategory(int userHandle, in ComponentName service, String category); boolean isDefaultServiceForAid(int userHandle, in ComponentName service, String aid); boolean setDefaultServiceForCategory(int userHandle, in ComponentName service, String category); List<ApduServiceInfo> getServices(int userHandle, in String category); } core/java/android/nfc/NfcAdapter.java +24 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ public final class NfcAdapter { // recovery static INfcAdapter sService; static INfcTag sTagService; static INfcCardEmulation sCardEmulationService; /** * The NfcAdapter object for each application context. Loading Loading @@ -348,6 +349,13 @@ public final class NfcAdapter { throw new UnsupportedOperationException(); } try { sCardEmulationService = sService.getNfcCardEmulationInterface(); } catch (RemoteException e) { Log.e(TAG, "could not retrieve card emulation service"); throw new UnsupportedOperationException(); } sIsInitialized = true; } if (context == null) { Loading Loading @@ -455,6 +463,15 @@ public final class NfcAdapter { return sTagService; } /** * Returns the binder interface to the card emulation service. * @hide */ public INfcCardEmulation getCardEmulationService() { isEnabled(); return sCardEmulationService; } /** * NFC service dead - attempt best effort recovery * @hide Loading @@ -477,6 +494,13 @@ public final class NfcAdapter { Log.e(TAG, "could not retrieve NFC tag service during service recovery"); // nothing more can be done now, sService is still stale, we'll hit // this recovery path again later return; } try { sCardEmulationService = service.getNfcCardEmulationInterface(); } catch (RemoteException ee) { Log.e(TAG, "could not retrieve NFC card emulation service during service recovery"); } return; Loading Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ LOCAL_SRC_FILES += \ core/java/android/nfc/INfcAdapter.aidl \ core/java/android/nfc/INfcAdapterExtras.aidl \ core/java/android/nfc/INfcTag.aidl \ core/java/android/nfc/INfcCardEmulation.aidl \ core/java/android/os/IBatteryPropertiesListener.aidl \ core/java/android/os/IBatteryPropertiesRegistrar.aidl \ core/java/android/os/ICancellationSignal.aidl \ Loading
api/current.txt +13 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ package android { field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET"; field public static final java.lang.String BIND_DEVICE_ADMIN = "android.permission.BIND_DEVICE_ADMIN"; field public static final java.lang.String BIND_INPUT_METHOD = "android.permission.BIND_INPUT_METHOD"; field public static final java.lang.String BIND_NFC_SERVICE = "android.permission.BIND_NFC_SERVICE"; field public static final java.lang.String BIND_NOTIFICATION_LISTENER_SERVICE = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"; field public static final java.lang.String BIND_PRINT_SERVICE = "android.permission.BIND_PRINT_SERVICE"; field public static final java.lang.String BIND_REMOTEVIEWS = "android.permission.BIND_REMOTEVIEWS"; Loading Loading @@ -14808,6 +14809,18 @@ package android.nfc { package android.nfc.cardemulation { public final class CardEmulationManager { method public static synchronized android.nfc.cardemulation.CardEmulationManager getInstance(android.nfc.NfcAdapter); method public boolean isDefaultServiceForAid(android.content.ComponentName, java.lang.String); method public boolean isDefaultServiceForCategory(android.content.ComponentName, java.lang.String); method public boolean setDefaultServiceForCategory(android.content.ComponentName, java.lang.String); field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.ACTION_CHANGE_DEFAULT"; field public static final java.lang.String CATEGORY_OTHER = "other"; field public static final java.lang.String CATEGORY_PAYMENT = "payment"; field public static final java.lang.String EXTRA_CATEGORY = "category"; field public static final java.lang.String EXTRA_SERVICE_COMPONENT = "component"; } public abstract class HostApduService extends android.app.Service { ctor public HostApduService(); method public final android.os.IBinder onBind(android.content.Intent);
core/java/android/nfc/INfcAdapter.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.nfc.TechListParcel; import android.nfc.INdefPushCallback; import android.nfc.INfcAdapterExtras; import android.nfc.INfcTag; import android.nfc.INfcCardEmulation; /** * @hide Loading @@ -31,6 +32,7 @@ import android.nfc.INfcTag; interface INfcAdapter { INfcTag getNfcTagInterface(); INfcCardEmulation getNfcCardEmulationInterface(); INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg); int getState(); Loading
core/java/android/nfc/INfcCardEmulation.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.nfc; import android.content.ComponentName; import android.nfc.cardemulation.ApduServiceInfo; import android.os.RemoteCallback; /** * @hide */ interface INfcCardEmulation { boolean isDefaultServiceForCategory(int userHandle, in ComponentName service, String category); boolean isDefaultServiceForAid(int userHandle, in ComponentName service, String aid); boolean setDefaultServiceForCategory(int userHandle, in ComponentName service, String category); List<ApduServiceInfo> getServices(int userHandle, in String category); }
core/java/android/nfc/NfcAdapter.java +24 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ public final class NfcAdapter { // recovery static INfcAdapter sService; static INfcTag sTagService; static INfcCardEmulation sCardEmulationService; /** * The NfcAdapter object for each application context. Loading Loading @@ -348,6 +349,13 @@ public final class NfcAdapter { throw new UnsupportedOperationException(); } try { sCardEmulationService = sService.getNfcCardEmulationInterface(); } catch (RemoteException e) { Log.e(TAG, "could not retrieve card emulation service"); throw new UnsupportedOperationException(); } sIsInitialized = true; } if (context == null) { Loading Loading @@ -455,6 +463,15 @@ public final class NfcAdapter { return sTagService; } /** * Returns the binder interface to the card emulation service. * @hide */ public INfcCardEmulation getCardEmulationService() { isEnabled(); return sCardEmulationService; } /** * NFC service dead - attempt best effort recovery * @hide Loading @@ -477,6 +494,13 @@ public final class NfcAdapter { Log.e(TAG, "could not retrieve NFC tag service during service recovery"); // nothing more can be done now, sService is still stale, we'll hit // this recovery path again later return; } try { sCardEmulationService = service.getNfcCardEmulationInterface(); } catch (RemoteException ee) { Log.e(TAG, "could not retrieve NFC card emulation service during service recovery"); } return; Loading