summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc/NfcAdapter.java
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-04-13 15:22:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-13 15:22:11 -0700
commita94afeb5b3c3c95c6d2cf0cd4d69587aba569cfb (patch)
tree092280ea7d53086241a35ff4ea546e43ebd884fa /core/java/android/nfc/NfcAdapter.java
parente64d187553cb3fa193b5748b5c99ad85cf9ccba1 (diff)
parent20e8dd9f9e7cff63c83e36a1761538a04c224cc1 (diff)
downloadframeworks_base-a94afeb5b3c3c95c6d2cf0cd4d69587aba569cfb.zip
frameworks_base-a94afeb5b3c3c95c6d2cf0cd4d69587aba569cfb.tar.gz
frameworks_base-a94afeb5b3c3c95c6d2cf0cd4d69587aba569cfb.tar.bz2
Merge "Unhide new Beam push APIs."
Diffstat (limited to 'core/java/android/nfc/NfcAdapter.java')
-rw-r--r--core/java/android/nfc/NfcAdapter.java43
1 files changed, 38 insertions, 5 deletions
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index 917751c..90f5bef 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -203,6 +203,27 @@ public final class NfcAdapter {
/** @hide */
public static final int STATE_TURNING_OFF = 4;
+ /** @hide */
+ public static final String ACTION_HANDOVER_TRANSFER_STARTED =
+ "android.nfc.action.HANDOVER_TRANSFER_STARTED";
+
+ /** @hide */
+ public static final String ACTION_HANDOVER_TRANSFER_DONE =
+ "android.nfc.action.HANDOVER_TRANSFER_DONE";
+
+ /** @hide */
+ public static final String EXTRA_HANDOVER_TRANSFER_STATUS =
+ "android.nfc.extra.HANDOVER_TRANSFER_STATUS";
+
+ /** @hide */
+ public static final int HANDOVER_TRANSFER_STATUS_SUCCESS = 0;
+ /** @hide */
+ public static final int HANDOVER_TRANSFER_STATUS_FAILURE = 1;
+
+ /** @hide */
+ public static final String EXTRA_HANDOVER_TRANSFER_URI =
+ "android.nfc.extra.HANDOVER_TRANSFER_URI";
+
// Guarded by NfcAdapter.class
static boolean sIsInitialized = false;
@@ -281,6 +302,12 @@ public final class NfcAdapter {
public NdefMessage createNdefMessage(NfcEvent event);
}
+
+ // TODO javadoc
+ public interface CreateBeamUrisCallback {
+ public Uri[] createBeamUris(NfcEvent event);
+ }
+
/**
* Helper to check if this device has FEATURE_NFC, but without using
* a context.
@@ -556,16 +583,22 @@ public final class NfcAdapter {
}
}
- //TODO: Consider a callback alternative
- //TOOD: See if we get rid of mimeType
//TODO: make sure NFC service has permission for URI
+ //TODO: see if we will eventually support multiple URIs
//TODO: javadoc
- /** @hide */
- public void setBeamPushUri(String mimeType, Uri uri, Activity activity) {
+ public void setBeamPushUris(Uri[] uris, Activity activity) {
+ if (activity == null) {
+ throw new NullPointerException("activity cannot be null");
+ }
+ mNfcActivityManager.setNdefPushContentUri(activity, uris);
+ }
+
+ // TODO javadoc
+ public void setBeamPushUrisCallback(CreateBeamUrisCallback callback, Activity activity) {
if (activity == null) {
throw new NullPointerException("activity cannot be null");
}
- mNfcActivityManager.setNdefPushContentUri(activity, mimeType, uri);
+ mNfcActivityManager.setNdefPushContentUriCallback(activity, callback);
}
/**