Loading api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -705,6 +705,17 @@ visibility="public" > </field> <field name="NFC" type="java.lang.String" transient="false" volatile="false" value=""android.permission.NFC"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="PERSISTENT_ACTIVITY" type="java.lang.String" transient="false" core/java/android/nfc/NdefTagConnection.java +10 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ import android.util.Log; * A connection to an NDEF target on an {@link NdefTag}. * <p>You can acquire this kind of connection with {@link NfcAdapter#createNdefTagConnection * createNdefTagConnection()}. Use the connection to read or write {@link NdefMessage}s. * <p class="note"><strong>Note:</strong> * Use of this class requires the {@link android.Manifest.permission#NFC} * permission. */ public class NdefTagConnection extends RawTagConnection { public static final int NDEF_MODE_READ_ONCE = 1; Loading Loading @@ -69,7 +72,7 @@ public class NdefTagConnection extends RawTagConnection { * This will always return the most up to date payload, and can block. * It can be canceled with {@link RawTagConnection#close}. * Most NDEF tags will contain just one NDEF message. * <p> * <p>Requires {@link android.Manifest.permission#NFC} permission. * @throws FormatException if the tag is not NDEF formatted * @throws IOException if the target is lost or connection closed * @throws FormatException Loading Loading @@ -109,8 +112,9 @@ public class NdefTagConnection extends RawTagConnection { * message. Use {@link NdefRecord} to write several records to a single tag. * For write-many tags, use {@link #makeReadOnly} after this method to attempt * to prevent further modification. For write-once tags this is not * neccesary. * Requires NFC_WRITE permission. * necessary. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @throws FormatException if the tag is not suitable for NDEF messages * @throws IOException if the target is lost or connection closed or the * write failed Loading Loading @@ -138,7 +142,7 @@ public class NdefTagConnection extends RawTagConnection { * Attempts to make the NDEF data in this tag read-only. * This method will block until the action is complete. It can be canceled * with {@link RawTagConnection#close}. * Requires NFC_WRITE permission. * <p>Requires {@link android.Manifest.permission#NFC} permission. * @return true if the tag is now read-only * @throws IOException if the target is lost, or connection closed */ Loading @@ -164,7 +168,8 @@ public class NdefTagConnection extends RawTagConnection { /** * Read/Write mode hint. * Provides a hint if further reads or writes are likely to suceed. * Provides a hint if further reads or writes are likely to succeed. * <p>Requires {@link android.Manifest.permission#NFC} permission. * @return one of NDEF_MODE * @throws IOException if the target is lost or connection closed */ Loading core/java/android/nfc/NfcAdapter.java +7 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; //TODO(npelly) permission {@link android.Manifest.permission#NFC_MODIFY} /** * Represents the device's local NFC adapter. * <p> Loading @@ -35,7 +34,7 @@ import android.util.Log; * to NFC Tags. * <p class="note"> * <strong>Note:</strong> Some methods require the * TODO permission. * {@link android.Manifest.permission#NFC} permission. */ public final class NfcAdapter { /** Loading Loading @@ -231,8 +230,7 @@ public final class NfcAdapter { * <li>provide the NDEF message on over LLCP to peer NFC adapters * </ul> * The NDEF message is preserved across reboot. * <p> * Requires NFC_WRITE permission * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param message NDEF message to make public */ Loading @@ -246,8 +244,7 @@ public final class NfcAdapter { /** * Get the NDEF Message that this adapter appears as to Tag readers. * <p> * Requires NFC_WRITE permission * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @return NDEF Message that is publicly readable */ Loading @@ -262,6 +259,7 @@ public final class NfcAdapter { /** * Create a raw tag connection to the default Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public RawTagConnection createRawTagConnection(Tag tag) { try { Loading @@ -274,6 +272,7 @@ public final class NfcAdapter { /** * Create a raw tag connection to the specified Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public RawTagConnection createRawTagConnection(Tag tag, String target) { try { Loading @@ -286,6 +285,7 @@ public final class NfcAdapter { /** * Create an NDEF tag connection to the default Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public NdefTagConnection createNdefTagConnection(NdefTag tag) { try { Loading @@ -298,6 +298,7 @@ public final class NfcAdapter { /** * Create an NDEF tag connection to the specified Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public NdefTagConnection createNdefTagConnection(NdefTag tag, String target) { try { Loading core/java/android/nfc/RawTagConnection.java +9 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import android.util.Log; * Applications must implement their own protocol stack on top of {@link #transceive transceive()}. * * <p class="note"><strong>Note:</strong> * Most methods require the TODO * Use of this class requires the {@link android.Manifest.permission#NFC} * permission. */ public class RawTagConnection { Loading Loading @@ -71,11 +71,15 @@ public class RawTagConnection { /** * Get the {@link Tag} this connection is associated with. * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public Tag getTag() { return mTag; } /** * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public String getTagTarget() { return mSelectedTarget; } Loading @@ -84,7 +88,7 @@ public class RawTagConnection { * Helper to indicate if {@link #transceive transceive()} calls might succeed. * <p> * Does not cause RF activity, and does not block. * <p> * <p>Requires {@link android.Manifest.permission#NFC} permission. * @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 {@link #transceive transceive()}, in case connection is lost after this method Loading @@ -104,7 +108,7 @@ public class RawTagConnection { * <p> * {@link #close} can be called from another thread to cancel this connection * attempt. * * <p>Requires {@link android.Manifest.permission#NFC} permission. * @throws IOException if the target is lost, or connect canceled */ public void connect() throws IOException { Loading @@ -120,6 +124,7 @@ public class RawTagConnection { * <p> * Once this method is called, this object cannot be re-used and should be discarded. Further * calls to {@link #transceive transceive()} or {@link #connect} will fail. * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public void close() { mIsConnected = false; Loading @@ -135,8 +140,7 @@ public class RawTagConnection { * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p> * Requires NFC_WRITE permission. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response Loading core/res/AndroidManifest.xml +4 −29 Original line number Diff line number Diff line Loading @@ -343,29 +343,12 @@ android:description="@string/permdesc_bluetooth" android:label="@string/permlab_bluetooth" /> <!-- Allows applications to access remote NFC devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_RAW" <!-- Allows applications to directly communicate over NFC --> <permission android:name="android.permission.NFC" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcRaw" android:label="@string/permlab_nfcRaw" /> <!-- Allows applications to be notified of remote NFC devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_NOTIFY" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcNotify" android:label="@string/permlab_nfcNotify" /> <!-- Allows applications to be notified of remote NFC LLCP devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_LLCP" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcLlcp" android:label="@string/permlab_nfcLlcp" /> android:description="@string/permdesc_nfc" android:label="@string/permlab_nfc" /> <!-- Allows an application to use SIP service --> <permission android:name="android.permission.USE_SIP" Loading Loading @@ -884,14 +867,6 @@ android:description="@string/permdesc_bluetoothAdmin" android:label="@string/permlab_bluetoothAdmin" /> <!-- Allows applications to change NFC connectivity settings @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_ADMIN" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcAdmin" android:label="@string/permlab_nfcAdmin" /> <!-- Allows an application to clear the caches of all installed applications on the device. --> <permission android:name="android.permission.CLEAR_APP_CACHE" Loading Loading
api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -705,6 +705,17 @@ visibility="public" > </field> <field name="NFC" type="java.lang.String" transient="false" volatile="false" value=""android.permission.NFC"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="PERSISTENT_ACTIVITY" type="java.lang.String" transient="false"
core/java/android/nfc/NdefTagConnection.java +10 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ import android.util.Log; * A connection to an NDEF target on an {@link NdefTag}. * <p>You can acquire this kind of connection with {@link NfcAdapter#createNdefTagConnection * createNdefTagConnection()}. Use the connection to read or write {@link NdefMessage}s. * <p class="note"><strong>Note:</strong> * Use of this class requires the {@link android.Manifest.permission#NFC} * permission. */ public class NdefTagConnection extends RawTagConnection { public static final int NDEF_MODE_READ_ONCE = 1; Loading Loading @@ -69,7 +72,7 @@ public class NdefTagConnection extends RawTagConnection { * This will always return the most up to date payload, and can block. * It can be canceled with {@link RawTagConnection#close}. * Most NDEF tags will contain just one NDEF message. * <p> * <p>Requires {@link android.Manifest.permission#NFC} permission. * @throws FormatException if the tag is not NDEF formatted * @throws IOException if the target is lost or connection closed * @throws FormatException Loading Loading @@ -109,8 +112,9 @@ public class NdefTagConnection extends RawTagConnection { * message. Use {@link NdefRecord} to write several records to a single tag. * For write-many tags, use {@link #makeReadOnly} after this method to attempt * to prevent further modification. For write-once tags this is not * neccesary. * Requires NFC_WRITE permission. * necessary. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @throws FormatException if the tag is not suitable for NDEF messages * @throws IOException if the target is lost or connection closed or the * write failed Loading Loading @@ -138,7 +142,7 @@ public class NdefTagConnection extends RawTagConnection { * Attempts to make the NDEF data in this tag read-only. * This method will block until the action is complete. It can be canceled * with {@link RawTagConnection#close}. * Requires NFC_WRITE permission. * <p>Requires {@link android.Manifest.permission#NFC} permission. * @return true if the tag is now read-only * @throws IOException if the target is lost, or connection closed */ Loading @@ -164,7 +168,8 @@ public class NdefTagConnection extends RawTagConnection { /** * Read/Write mode hint. * Provides a hint if further reads or writes are likely to suceed. * Provides a hint if further reads or writes are likely to succeed. * <p>Requires {@link android.Manifest.permission#NFC} permission. * @return one of NDEF_MODE * @throws IOException if the target is lost or connection closed */ Loading
core/java/android/nfc/NfcAdapter.java +7 −6 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; //TODO(npelly) permission {@link android.Manifest.permission#NFC_MODIFY} /** * Represents the device's local NFC adapter. * <p> Loading @@ -35,7 +34,7 @@ import android.util.Log; * to NFC Tags. * <p class="note"> * <strong>Note:</strong> Some methods require the * TODO permission. * {@link android.Manifest.permission#NFC} permission. */ public final class NfcAdapter { /** Loading Loading @@ -231,8 +230,7 @@ public final class NfcAdapter { * <li>provide the NDEF message on over LLCP to peer NFC adapters * </ul> * The NDEF message is preserved across reboot. * <p> * Requires NFC_WRITE permission * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param message NDEF message to make public */ Loading @@ -246,8 +244,7 @@ public final class NfcAdapter { /** * Get the NDEF Message that this adapter appears as to Tag readers. * <p> * Requires NFC_WRITE permission * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @return NDEF Message that is publicly readable */ Loading @@ -262,6 +259,7 @@ public final class NfcAdapter { /** * Create a raw tag connection to the default Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public RawTagConnection createRawTagConnection(Tag tag) { try { Loading @@ -274,6 +272,7 @@ public final class NfcAdapter { /** * Create a raw tag connection to the specified Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public RawTagConnection createRawTagConnection(Tag tag, String target) { try { Loading @@ -286,6 +285,7 @@ public final class NfcAdapter { /** * Create an NDEF tag connection to the default Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public NdefTagConnection createNdefTagConnection(NdefTag tag) { try { Loading @@ -298,6 +298,7 @@ public final class NfcAdapter { /** * Create an NDEF tag connection to the specified Target * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public NdefTagConnection createNdefTagConnection(NdefTag tag, String target) { try { Loading
core/java/android/nfc/RawTagConnection.java +9 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import android.util.Log; * Applications must implement their own protocol stack on top of {@link #transceive transceive()}. * * <p class="note"><strong>Note:</strong> * Most methods require the TODO * Use of this class requires the {@link android.Manifest.permission#NFC} * permission. */ public class RawTagConnection { Loading Loading @@ -71,11 +71,15 @@ public class RawTagConnection { /** * Get the {@link Tag} this connection is associated with. * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public Tag getTag() { return mTag; } /** * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public String getTagTarget() { return mSelectedTarget; } Loading @@ -84,7 +88,7 @@ public class RawTagConnection { * Helper to indicate if {@link #transceive transceive()} calls might succeed. * <p> * Does not cause RF activity, and does not block. * <p> * <p>Requires {@link android.Manifest.permission#NFC} permission. * @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 {@link #transceive transceive()}, in case connection is lost after this method Loading @@ -104,7 +108,7 @@ public class RawTagConnection { * <p> * {@link #close} can be called from another thread to cancel this connection * attempt. * * <p>Requires {@link android.Manifest.permission#NFC} permission. * @throws IOException if the target is lost, or connect canceled */ public void connect() throws IOException { Loading @@ -120,6 +124,7 @@ public class RawTagConnection { * <p> * Once this method is called, this object cannot be re-used and should be discarded. Further * calls to {@link #transceive transceive()} or {@link #connect} will fail. * <p>Requires {@link android.Manifest.permission#NFC} permission. */ public void close() { mIsConnected = false; Loading @@ -135,8 +140,7 @@ public class RawTagConnection { * <p> * This method will block until the response is received. It can be canceled * with {@link #close}. * <p> * Requires NFC_WRITE permission. * <p>Requires {@link android.Manifest.permission#NFC} permission. * * @param data bytes to send * @return bytes received in response Loading
core/res/AndroidManifest.xml +4 −29 Original line number Diff line number Diff line Loading @@ -343,29 +343,12 @@ android:description="@string/permdesc_bluetooth" android:label="@string/permlab_bluetooth" /> <!-- Allows applications to access remote NFC devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_RAW" <!-- Allows applications to directly communicate over NFC --> <permission android:name="android.permission.NFC" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcRaw" android:label="@string/permlab_nfcRaw" /> <!-- Allows applications to be notified of remote NFC devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_NOTIFY" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcNotify" android:label="@string/permlab_nfcNotify" /> <!-- Allows applications to be notified of remote NFC LLCP devices @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_LLCP" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcLlcp" android:label="@string/permlab_nfcLlcp" /> android:description="@string/permdesc_nfc" android:label="@string/permlab_nfc" /> <!-- Allows an application to use SIP service --> <permission android:name="android.permission.USE_SIP" Loading Loading @@ -884,14 +867,6 @@ android:description="@string/permdesc_bluetoothAdmin" android:label="@string/permlab_bluetoothAdmin" /> <!-- Allows applications to change NFC connectivity settings @hide --> <permission android:name="com.trustedlogic.trustednfc.permission.NFC_ADMIN" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:protectionLevel="dangerous" android:description="@string/permdesc_nfcAdmin" android:label="@string/permlab_nfcAdmin" /> <!-- Allows an application to clear the caches of all installed applications on the device. --> <permission android:name="android.permission.CLEAR_APP_CACHE" Loading