Skip to content

Commit f003e26

Browse files
author
Nick Pelly
committed
Final final final Gingerbread MR API changes.
This is it. I promise. ACTION_TECHNOLOGY_DISCOVERED -> ACTION_TECH_DISCOVERED This was missed in our technology->tech rename. Hide TagTechnology.reconnect() This is used to reset any per-connection state in a tag, by reconnecting to it. The first problem is that it belongs on Tag, not TagTechnology. The second problem is that it may become redundant once we add Tag.rediscover() which will also reconnect to the tag, and will also return a new Tag with newly created technologies enumerated. And the third and most significant problem is that you can already achieve the same result by just calling close() followed by connect(). Hide Tag.createMockTag() This API cannot be used reliably. First it requires using int[] for the technology list, but those int constants are now hidden. Second it requires knowledge of the extras parcel used to fill technology specific data - also not public. Introduce TagTechnology.isConnected() Every child class already impelmented this, and given that connect() and close() are defined on the interface, then isConnected() should be there too. Modify Ndef.getType to return a string (not int) Allows more flexibility in adding new NDEF types. Current public strings are org.nfcforum.ndef.type1 org.nfcforum.ndef.type2 org.nfcforum.ndef.type3 org.nfcforum.ndef.type4 com.nxp.ndef.mifareclassic Add NdefFormatable.formatReadOnly() This allows you to make the tag read-only at the same time as performing format and write. It is important because we currently don't have any public API to re-enumerate a tag technology list after making a tag NDEF compatible, so you can't perform the format as a seperate step without physically removing the tag from field and returning it. Modify Readonly -> ReadOnly Make Tag class final Change-Id: Icf306aeb37b936ca3007e4868e99b6baceac4aff
1 parent 113834c commit f003e26

File tree

8 files changed

+165
-151
lines changed

8 files changed

+165
-151
lines changed

api/10.xml

Lines changed: 34 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -100906,7 +100906,7 @@
100906100906
visibility="public"
100907100907
>
100908100908
</field>
100909-
<field name="ACTION_TECHNOLOGY_DISCOVERED"
100909+
<field name="ACTION_TECH_DISCOVERED"
100910100910
type="java.lang.String"
100911100911
transient="false"
100912100912
volatile="false"
@@ -100975,29 +100975,12 @@
100975100975
extends="java.lang.Object"
100976100976
abstract="false"
100977100977
static="false"
100978-
final="false"
100978+
final="true"
100979100979
deprecated="not deprecated"
100980100980
visibility="public"
100981100981
>
100982100982
<implements name="android.os.Parcelable">
100983100983
</implements>
100984-
<method name="createMockTag"
100985-
return="android.nfc.Tag"
100986-
abstract="false"
100987-
native="false"
100988-
synchronized="false"
100989-
static="true"
100990-
final="false"
100991-
deprecated="not deprecated"
100992-
visibility="public"
100993-
>
100994-
<parameter name="id" type="byte[]">
100995-
</parameter>
100996-
<parameter name="techList" type="int[]">
100997-
</parameter>
100998-
<parameter name="techListExtras" type="android.os.Bundle[]">
100999-
</parameter>
101000-
</method>
101001100984
<method name="describeContents"
101002100985
return="int"
101003100986
abstract="false"
@@ -101145,19 +101128,6 @@
101145101128
visibility="public"
101146101129
>
101147101130
</method>
101148-
<method name="reconnect"
101149-
return="void"
101150-
abstract="false"
101151-
native="false"
101152-
synchronized="false"
101153-
static="false"
101154-
final="false"
101155-
deprecated="not deprecated"
101156-
visibility="public"
101157-
>
101158-
<exception name="IOException" type="java.io.IOException">
101159-
</exception>
101160-
</method>
101161101131
</class>
101162101132
<class name="IsoDep"
101163101133
extends="android.nfc.tech.BasicTagTechnology"
@@ -101745,7 +101715,7 @@
101745101715
deprecated="not deprecated"
101746101716
visibility="public"
101747101717
>
101748-
<method name="canMakeReadonly"
101718+
<method name="canMakeReadOnly"
101749101719
return="boolean"
101750101720
abstract="false"
101751101721
native="false"
@@ -101807,7 +101777,7 @@
101807101777
</exception>
101808101778
</method>
101809101779
<method name="getType"
101810-
return="int"
101780+
return="java.lang.String"
101811101781
abstract="false"
101812101782
native="false"
101813101783
synchronized="false"
@@ -101828,7 +101798,7 @@
101828101798
visibility="public"
101829101799
>
101830101800
</method>
101831-
<method name="makeReadonly"
101801+
<method name="makeReadOnly"
101832101802
return="boolean"
101833101803
abstract="false"
101834101804
native="false"
@@ -101859,65 +101829,54 @@
101859101829
</exception>
101860101830
</method>
101861101831
<field name="MIFARE_CLASSIC"
101862-
type="int"
101832+
type="java.lang.String"
101863101833
transient="false"
101864101834
volatile="false"
101865-
value="101"
101835+
value="&quot;com.nxp.ndef.mifareclassic&quot;"
101866101836
static="true"
101867101837
final="true"
101868101838
deprecated="not deprecated"
101869101839
visibility="public"
101870101840
>
101871101841
</field>
101872101842
<field name="NFC_FORUM_TYPE_1"
101873-
type="int"
101843+
type="java.lang.String"
101874101844
transient="false"
101875101845
volatile="false"
101876-
value="1"
101846+
value="&quot;org.nfcforum.ndef.type1&quot;"
101877101847
static="true"
101878101848
final="true"
101879101849
deprecated="not deprecated"
101880101850
visibility="public"
101881101851
>
101882101852
</field>
101883101853
<field name="NFC_FORUM_TYPE_2"
101884-
type="int"
101854+
type="java.lang.String"
101885101855
transient="false"
101886101856
volatile="false"
101887-
value="2"
101857+
value="&quot;org.nfcforum.ndef.type2&quot;"
101888101858
static="true"
101889101859
final="true"
101890101860
deprecated="not deprecated"
101891101861
visibility="public"
101892101862
>
101893101863
</field>
101894101864
<field name="NFC_FORUM_TYPE_3"
101895-
type="int"
101865+
type="java.lang.String"
101896101866
transient="false"
101897101867
volatile="false"
101898-
value="3"
101868+
value="&quot;org.nfcforum.ndef.type3&quot;"
101899101869
static="true"
101900101870
final="true"
101901101871
deprecated="not deprecated"
101902101872
visibility="public"
101903101873
>
101904101874
</field>
101905101875
<field name="NFC_FORUM_TYPE_4"
101906-
type="int"
101907-
transient="false"
101908-
volatile="false"
101909-
value="4"
101910-
static="true"
101911-
final="true"
101912-
deprecated="not deprecated"
101913-
visibility="public"
101914-
>
101915-
</field>
101916-
<field name="OTHER"
101917-
type="int"
101876+
type="java.lang.String"
101918101877
transient="false"
101919101878
volatile="false"
101920-
value="-1"
101879+
value="&quot;org.nfcforum.ndef.type4&quot;"
101921101880
static="true"
101922101881
final="true"
101923101882
deprecated="not deprecated"
@@ -101950,6 +101909,23 @@
101950101909
<exception name="IOException" type="java.io.IOException">
101951101910
</exception>
101952101911
</method>
101912+
<method name="formatReadOnly"
101913+
return="void"
101914+
abstract="false"
101915+
native="false"
101916+
synchronized="false"
101917+
static="false"
101918+
final="false"
101919+
deprecated="not deprecated"
101920+
visibility="public"
101921+
>
101922+
<parameter name="firstMessage" type="android.nfc.NdefMessage">
101923+
</parameter>
101924+
<exception name="FormatException" type="android.nfc.FormatException">
101925+
</exception>
101926+
<exception name="IOException" type="java.io.IOException">
101927+
</exception>
101928+
</method>
101953101929
<method name="get"
101954101930
return="android.nfc.tech.NdefFormatable"
101955101931
abstract="false"
@@ -102246,8 +102222,8 @@
102246102222
visibility="public"
102247102223
>
102248102224
</method>
102249-
<method name="reconnect"
102250-
return="void"
102225+
<method name="isConnected"
102226+
return="boolean"
102251102227
abstract="true"
102252102228
native="false"
102253102229
synchronized="false"
@@ -102256,8 +102232,6 @@
102256102232
deprecated="not deprecated"
102257102233
visibility="public"
102258102234
>
102259-
<exception name="IOException" type="java.io.IOException">
102260-
</exception>
102261102235
</method>
102262102236
</interface>
102263102237
</package>

0 commit comments

Comments
 (0)