First pass at advanced NFC tag dispatching APIs and other cleanup.
Change-Id: I288a13cea9967c2f852200e8bd1a802b7d96655d
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8410b20..0af8309 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -47,11 +47,19 @@
android:theme="@android:style/Theme.NoTitleBar"
android:launchMode="singleTop"
>
+ <!-- Catch the generic intent so we can display something for unknown tags -->
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
+ <!-- Offer to display anything with NDEF data -->
+ <intent-filter>
+ <action android:name="android.nfc.action.TECH_DISCOVERED"/>
+ <data android:scheme="vnd.android.nfc" android:host="tag" android:pathPattern=".*\/6\/.*" />
+ <category android:name="android.intent.category.DEFAULT"/>
+ </intent-filter>
+
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="vnd.android.cursor.item/ndef_msg"/>
diff --git a/src/com/android/apps/tag/TagViewer.java b/src/com/android/apps/tag/TagViewer.java
index 97356b8..99efc3b 100644
--- a/src/com/android/apps/tag/TagViewer.java
+++ b/src/com/android/apps/tag/TagViewer.java
@@ -155,7 +155,8 @@
void resolveIntent(Intent intent) {
// Parse the intent
String action = intent.getAction();
- if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
+ if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
+ || NfcAdapter.ACTION_TECHNOLOGY_DISCOVERED.equals(action)) {
if (SHOW_OVER_LOCK_SCREEN) {
// A tag was just scanned so poke the user activity wake lock to keep
// the screen on a bit longer in the event that the activity has