Update to the new APIs for tech dispatch.
Change-Id: I13f3d9a9ec04af6a230fca99c0303f0328a2a14a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 5ec59fe..ecc63e3 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -62,10 +62,12 @@
<!-- 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>
+ <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
+ android:resource="@xml/filter_nfc"
+ />
+
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="vnd.android.cursor.item/ndef_msg"/>
diff --git a/res/xml/filter_nfc.xml b/res/xml/filter_nfc.xml
new file mode 100644
index 0000000..c0916be
--- /dev/null
+++ b/res/xml/filter_nfc.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- capture anything containing NDEF -->
+ <tech-list>
+ <tech>android.nfc.tech.Ndef</tech>
+ </tech-list>
+</resources>
diff --git a/src/com/android/apps/tag/WriteTagActivity.java b/src/com/android/apps/tag/WriteTagActivity.java
index d82d042..11ed9e1 100644
--- a/src/com/android/apps/tag/WriteTagActivity.java
+++ b/src/com/android/apps/tag/WriteTagActivity.java
@@ -113,7 +113,7 @@
@Override
public void onResume() {
super.onResume();
- mAdapter.enableForegroundDispatch(this, mPendingIntent, (IntentFilter[]) null);
+ mAdapter.enableForegroundDispatch(this, mPendingIntent, null, null);
}
@Override