diff options
author | Nick Pelly <npelly@google.com> | 2011-01-31 23:27:37 -0800 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2011-02-01 09:20:45 -0800 |
commit | f003e26df96067b4b136f0859012cb7ec3ed930f (patch) | |
tree | ba9fc5774bf961c77eadcf4ac427739b26771859 /core/java/android/nfc/tech/TagTechnology.java | |
parent | 113834c5ab30bfc554202d0f3144a662d77f2484 (diff) | |
download | frameworks_base-f003e26df96067b4b136f0859012cb7ec3ed930f.zip frameworks_base-f003e26df96067b4b136f0859012cb7ec3ed930f.tar.gz frameworks_base-f003e26df96067b4b136f0859012cb7ec3ed930f.tar.bz2 |
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
Diffstat (limited to 'core/java/android/nfc/tech/TagTechnology.java')
-rw-r--r-- | core/java/android/nfc/tech/TagTechnology.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/nfc/tech/TagTechnology.java b/core/java/android/nfc/tech/TagTechnology.java index c8ccdcf..50df865 100644 --- a/core/java/android/nfc/tech/TagTechnology.java +++ b/core/java/android/nfc/tech/TagTechnology.java @@ -121,6 +121,7 @@ public interface TagTechnology extends Closeable { * @see #connect() * @see #close() * @throws IOException + * @hide */ public void reconnect() throws IOException; @@ -137,4 +138,15 @@ public interface TagTechnology extends Closeable { * @see #reconnect() */ public void close() throws IOException; + + /** + * Helper to indicate if {@link #connect} has succeeded. + * <p> + * Does not cause RF activity, and does not block. + * @return true if {@link #connect} has completed successfully and the {@link Tag} is believed + * to be within range. Applications must still handle {@link java.io.IOException} + * while using methods that require a connection in case the connection is lost after this + * method returns. + */ + public boolean isConnected(); } |