Skip to content

Commit 2d68a6b

Browse files
committed
docs: mix of BT and NFC javadoc updates
Add Health profile to various discussions about profiles Add descriptions to NFC interfaces, tweak some desciptions, and fix some broken links Change-Id: Ib89434c78a4ad60b4358dca9a6c335451d1c4125
1 parent e187d81 commit 2d68a6b

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

core/java/android/bluetooth/BluetoothAdapter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ public int getConnectionState() {
781781
* Get the current connection state of a profile.
782782
* This function can be used to check whether the local Bluetooth adapter
783783
* is connected to any remote device for a specific profile.
784-
* Profile can be one of {@link BluetoothProfile#HEADSET},
784+
* Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET},
785785
* {@link BluetoothProfile#A2DP}.
786786
*
787787
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
@@ -1132,15 +1132,15 @@ public Pair<byte[], byte[]> readOutOfBandData() {
11321132
/**
11331133
* Get the profile proxy object associated with the profile.
11341134
*
1135-
* <p>Profile can be one of {@link BluetoothProfile#HEADSET} or
1135+
* <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
11361136
* {@link BluetoothProfile#A2DP}. Clients must implements
11371137
* {@link BluetoothProfile.ServiceListener} to get notified of
11381138
* the connection status and to get the proxy object.
11391139
*
11401140
* @param context Context of the application
11411141
* @param listener The service Listener for connection callbacks.
1142-
* @param profile The Bluetooth profile; either {@link BluetoothProfile#HEADSET}
1143-
* or {@link BluetoothProfile#A2DP}.
1142+
* @param profile The Bluetooth profile; either {@link BluetoothProfile#HEALTH},
1143+
* {@link BluetoothProfile#HEADSET} or {@link BluetoothProfile#A2DP}.
11441144
* @return true on success, false on error
11451145
*/
11461146
public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener listener,
@@ -1172,7 +1172,7 @@ public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener
11721172
*
11731173
* <p> Clients should call this when they are no longer using
11741174
* the proxy obtained from {@link #getProfileProxy}.
1175-
* Profile can be one of {@link BluetoothProfile#HEADSET} or
1175+
* Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
11761176
* {@link BluetoothProfile#A2DP}
11771177
*
11781178
* @param profile

core/java/android/bluetooth/BluetoothProfile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,17 @@ public interface ServiceListener {
161161
/**
162162
* Called to notify the client when the proxy object has been
163163
* connected to the service.
164-
* @param profile - One of {@link #HEADSET} or
164+
* @param profile - One of {@link #HEALTH}, {@link #HEADSET} or
165165
* {@link #A2DP}
166-
* @param proxy - One of {@link BluetoothHeadset} or
166+
* @param proxy - One of {@link BluetoothHealth}, {@link BluetoothHeadset} or
167167
* {@link BluetoothA2dp}
168168
*/
169169
public void onServiceConnected(int profile, BluetoothProfile proxy);
170170

171171
/**
172172
* Called to notify the client that this proxy object has been
173173
* disconnected from the service.
174-
* @param profile - One of {@link #HEADSET} or
174+
* @param profile - One of {@link #HEALTH}, {@link #HEADSET} or
175175
* {@link #A2DP}
176176
*/
177177
public void onServiceDisconnected(int profile);

core/java/android/nfc/NfcAdapter.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ public final class NfcAdapter {
208208
final NfcActivityManager mNfcActivityManager;
209209

210210
/**
211-
* @see {@link #setNdefPushMessageCallback}
211+
* A callback to be invoked when the system successfully delivers your {@link NdefMessage}
212+
* to another device.
213+
* @see #setOnNdefPushCompleteCallback
212214
*/
213215
public interface OnNdefPushCompleteCallback {
214216
/**
@@ -217,13 +219,21 @@ public interface OnNdefPushCompleteCallback {
217219
* <p>This callback is usually made on a binder thread (not the UI thread).
218220
*
219221
* @param event {@link NfcEvent} with the {@link NfcEvent#nfcAdapter} field set
220-
* @see {@link #setNdefPushMessageCallback}
222+
* @see #setNdefPushMessageCallback
221223
*/
222224
public void onNdefPushComplete(NfcEvent event);
223225
}
224226

225227
/**
226-
* @see {@link #setCeateNdefMessageCallback}
228+
* A callback to be invoked when another NFC device capable of NDEF push (Android Beam)
229+
* is within range.
230+
* <p>Implement this interface and pass it to {@link
231+
* NfcAdapter#setNdefPushMessageCallback setNdefPushMessageCallback()} in order to create an
232+
* {@link NdefMessage} at the moment that another device is within range for NFC. Using this
233+
* callback allows you to create a message with data that might vary based on the
234+
* content currently visible to the user. Alternatively, you can call {@link
235+
* #setNdefPushMessage setNdefPushMessage()} if the {@link NdefMessage} always contains the
236+
* same data.
227237
*/
228238
public interface CreateNdefMessageCallback {
229239
/**
@@ -507,13 +517,15 @@ public boolean disable() {
507517
* <p>Pass a null NDEF message to disable foreground NDEF push in the
508518
* specified activities.
509519
*
510-
* <p>One or more activities must be specified.
520+
* <p>At least one activity must be specified, and usually only one is necessary.
511521
*
512522
* <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
513523
*
514524
* @param message NDEF message to push over NFC, or null to disable
515-
* @param activity an activity to enable for NDEF push (at least one is required)
516-
* @param activities zero or more additional activities to enable for NDEF Push
525+
* @param activity an activity in which NDEF push should be enabled to share the provided
526+
* NDEF message
527+
* @param activities optional additional activities that should also enable NDEF push with
528+
* the provided NDEF message
517529
*/
518530
public void setNdefPushMessage(NdefMessage message, Activity activity,
519531
Activity ... activities) {
@@ -544,13 +556,15 @@ public void setNdefPushMessage(NdefMessage message, Activity activity,
544556
* <p>Pass a null callback to disable the callback in the
545557
* specified activities.
546558
*
547-
* <p>One or more activities must be specified.
559+
* <p>At least one activity must be specified, and usually only one is necessary.
548560
*
549561
* <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
550562
*
551563
* @param callback callback, or null to disable
552-
* @param activity an activity to enable for NDEF push (at least one is required)
553-
* @param activities zero or more additional activities to enable for NDEF Push
564+
* @param activity an activity in which NDEF push should be enabled to share an NDEF message
565+
* that's retrieved from the provided callback
566+
* @param activities optional additional activities that should also enable NDEF push using
567+
* the provided callback
554568
*/
555569
public void setNdefPushMessageCallback(CreateNdefMessageCallback callback, Activity activity,
556570
Activity ... activities) {

core/java/android/nfc/NfcEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
* in the callback) because it allows new fields to be added without breaking
3030
* API compatibility.
3131
*
32-
* @see {@link NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete}
33-
* @see {@link NfcAdapter.CreateNdefMessageCallback#createNdefMessage}
32+
* @see NfcAdapter.OnNdefPushCompleteCallback#onNdefPushComplete
33+
* @see NfcAdapter.CreateNdefMessageCallback#createNdefMessage
3434
*/
3535
public final class NfcEvent {
3636
/**

0 commit comments

Comments
 (0)