summaryrefslogtreecommitdiff
path: root/framework/java
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-07 13:05:33 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-03-07 13:05:33 -0800
commit251a56a4ab5082929b9c2b45fa443344bac36fd8 (patch)
tree7999ee8d977c8430d9fee589e7bd2161c9343e07 /framework/java
parent0bbd8b219185eb81e6f9e325b907f8952648d822 (diff)
parent115e328290933fbf57205b8d0d922451548e5d9f (diff)
Merge "Errorprone enforce multiples" into main am: d864eb8510 am: 115e328290
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3511655 Change-Id: I479d483431d2cf460e625d72b3dcb88fd318e1cd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'framework/java')
-rw-r--r--framework/java/android/bluetooth/AudioInputControl.java20
-rw-r--r--framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java7
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java26
-rw-r--r--framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java3
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java10
-rw-r--r--framework/java/android/bluetooth/BluetoothLeBroadcast.java2
-rw-r--r--framework/java/android/bluetooth/BluetoothUtils.java2
-rw-r--r--framework/java/android/bluetooth/le/BluetoothLeUtils.java3
8 files changed, 28 insertions, 45 deletions
diff --git a/framework/java/android/bluetooth/AudioInputControl.java b/framework/java/android/bluetooth/AudioInputControl.java
index b39458b15f..eb89a4cab3 100644
--- a/framework/java/android/bluetooth/AudioInputControl.java
+++ b/framework/java/android/bluetooth/AudioInputControl.java
@@ -333,7 +333,7 @@ public class AudioInputControl {
/** see {@link #setDescription(String)} */
default void onDescriptionChanged(@NonNull String description) {}
- /** see {@link #getStatus()} */
+ /** see {@link #getAudioInputStatus()} */
default void onAudioInputStatusChanged(@AudioInputStatus int status) {}
/** see {@link #setGainSetting(int)} */
@@ -564,8 +564,8 @@ public class AudioInputControl {
/**
* Sets the gain setting as defined in AICS 1.0 - 3.5.2.1.
*
- * <p>The operation will fail if the current gain mode is {@link #AUTOMATIC} or {@link
- * #AUTOMATIC_ONLY}.
+ * <p>The operation will fail if the current gain mode is {@link #GAIN_MODE_AUTOMATIC} or {@link
+ * #GAIN_MODE_AUTOMATIC_ONLY}.
*
* <p>Register an {@link AudioInputControl.AudioInputCallback} to be notified via
*
@@ -585,8 +585,8 @@ public class AudioInputControl {
* #getGainSettingUnit()} to knows how much decibel this represents.
* @return true if the operation is successfully initiated, false otherwise. The callback {@link
* AudioInputCallback#onSetGainSettingFailed()} will not be call if false is returned
- * @throws IllegalStateException if the gain mode is {@link #AUTOMATIC} or {@link
- * #AUTOMATIC_ONLY}
+ * @throws IllegalStateException if the gain mode is {@link #GAIN_MODE_AUTOMATIC} or {@link
+ * #GAIN_MODE_AUTOMATIC_ONLY}
* @throws IllegalArgumentException if the gain setting is not in range
*/
@RequiresBluetoothConnectPermission
@@ -614,14 +614,14 @@ public class AudioInputControl {
return callService(
mService,
s -> s.getAudioInputGainMode(mAttributionSource, mDevice, mInstanceId),
- (int) bluetooth.constants.aics.GainMode.AUTOMATIC_ONLY);
+ GAIN_MODE_AUTOMATIC_ONLY);
}
/**
* Sets the gain mode as defined in AICS 1.0 - 3.5.2.4/5.
*
- * <p>The operation will fail if the current gain mode is {@link #MANUAL_ONLY} or {@link
- * #AUTOMATIC_ONLY}.
+ * <p>The operation will fail if the current gain mode is {@link #GAIN_MODE_MANUAL_ONLY} or
+ * {@link #GAIN_MODE_AUTOMATIC_ONLY}.
*
* <p>Register an {@link AudioInputControl.AudioInputCallback} to be notified via
*
@@ -634,8 +634,8 @@ public class AudioInputControl {
* @param gainMode The desired gain mode
* @return true if the operation is successfully initiated, false otherwise. The callback {@link
* AudioInputCallback#onSetGainModeFailed()} will not be call if false is returned
- * @throws IllegalStateException if the gain mode is {@link #MANUAL_ONLY} or {@link
- * #AUTOMATIC_ONLY}
+ * @throws IllegalStateException if the gain mode is {@link #GAIN_MODE_MANUAL_ONLY} or {@link
+ * #GAIN_MODE_AUTOMATIC_ONLY}
* @throws IllegalArgumentException if the gain mode value is invalid.
*/
@RequiresBluetoothConnectPermission
diff --git a/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java b/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
index 1dc5c3bf92..52bb0fd0dd 100644
--- a/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
+++ b/framework/java/android/bluetooth/BluetoothActivityEnergyInfo.java
@@ -139,12 +139,9 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
}
/**
- * Get the Bluetooth stack state associated with the energy info.
- *
- * @return one of {@link #BluetoothStackState} states
+ * @return the Bluetooth stack state associated with the energy info.
*/
- @BluetoothStackState
- public int getBluetoothStackState() {
+ public @BluetoothStackState int getBluetoothStackState() {
return mBluetoothStackState;
}
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 8f2edc546d..ac53cfdff8 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -506,8 +506,8 @@ public final class BluetoothAdapter {
@SystemApi public static final int BT_SNOOP_LOG_MODE_FILTERED = 1;
/**
- * Used as parameter for {@link #setSnoopLogMode}, indicates that the Bluetooth HCI snoop
- * logging should be enabled.
+ * Used as parameter for {@link #setBluetoothHciSnoopLoggingMode}, indicates that the Bluetooth
+ * HCI snoop logging should be enabled.
*
* <p>See {@link #BT_SNOOP_LOG_MODE_FILTERED} to enable logging with filtered information.
*
@@ -4714,21 +4714,20 @@ public final class BluetoothAdapter {
}
/**
- * Register a {@link #OnMetadataChangedListener} to receive update about metadata changes for
+ * Register a {@link OnMetadataChangedListener} to receive update about metadata changes for
* this {@link BluetoothDevice}. Registration must be done when Bluetooth is ON and will last
- * until {@link #removeOnMetadataChangedListener(BluetoothDevice)} is called, even when
- * Bluetooth restarted in the middle. All input parameters should not be null or {@link
- * NullPointerException} will be triggered. The same {@link BluetoothDevice} and {@link
- * #OnMetadataChangedListener} pair can only be registered once, double registration would cause
- * {@link IllegalArgumentException}.
+ * until {@link #removeOnMetadataChangedListener} is called, even when Bluetooth restarted in
+ * the middle. All input parameters should not be null or {@link NullPointerException} will be
+ * triggered. The same {@link BluetoothDevice} and {@link OnMetadataChangedListener} pair can
+ * only be registered once, double registration would cause {@link IllegalArgumentException}.
*
* @param device {@link BluetoothDevice} that will be registered
* @param executor the executor for listener callback
- * @param listener {@link #OnMetadataChangedListener} that will receive asynchronous callbacks
+ * @param listener {@link OnMetadataChangedListener} that will receive asynchronous callbacks
* @return true on success, false on error
* @throws NullPointerException If one of {@code listener}, {@code device} or {@code executor}
* is null.
- * @throws IllegalArgumentException The same {@link #OnMetadataChangedListener} and {@link
+ * @throws IllegalArgumentException The same {@link OnMetadataChangedListener} and {@link
* BluetoothDevice} are registered twice.
* @hide
*/
@@ -4795,10 +4794,9 @@ public final class BluetoothAdapter {
}
/**
- * Unregister a {@link #OnMetadataChangedListener} from a registered {@link BluetoothDevice}.
+ * Unregister a {@link OnMetadataChangedListener} from a registered {@link BluetoothDevice}.
* Unregistration can be done when Bluetooth is either ON or OFF. {@link
- * #addOnMetadataChangedListener(OnMetadataChangedListener, BluetoothDevice, Executor)} must be
- * called before unregistration.
+ * #addOnMetadataChangedListener} must be called before unregistration.
*
* @param device {@link BluetoothDevice} that will be unregistered. It should not be null or
* {@link NullPointerException} will be triggered.
@@ -5539,7 +5537,7 @@ public final class BluetoothAdapter {
* the report supports five event types: Quality monitor event, Approaching LSTO event, A2DP
* choppy event, SCO choppy event and Connect fail event. To know which kind of event is
* wrapped in this {@link BluetoothQualityReport} object, you need to call {@link
- * #getQualityReportId}.
+ * BluetoothQualityReport#getQualityReportId}.
*
* @param device is the BluetoothDevice which connection quality is being reported
* @param bluetoothQualityReport a Parcel that contains info about Bluetooth Quality
diff --git a/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java b/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java
index 9ec499d002..db03b15ad7 100644
--- a/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java
+++ b/framework/java/android/bluetooth/BluetoothCsipSetCoordinator.java
@@ -86,7 +86,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
@interface Status {}
/**
- * Callback is invoked as a result on {@link #groupLock()}.
+ * Callback is invoked as a result on {@link BluetoothCsipSetCoordinator#lockGroup()}.
*
* @param groupId group identifier
* @param opStatus status of lock operation
@@ -115,7 +115,6 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
mExecutor, () -> mCallback.onGroupLockSet(groupId, opStatus, isLocked));
}
}
- ;
/**
* Intent used to broadcast the change in connection state of the CSIS Client.
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index 8c053201e9..c7f3b8a052 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -375,14 +375,6 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
/**
- * Used as a Parcelable {@link BluetoothQualityReport} extra field in {@link
- * #ACTION_REMOTE_ISSUE_OCCURRED} intent. It contains the {@link BluetoothQualityReport}.
- *
- * @hide
- */
- public static final String EXTRA_BQR = "android.bluetooth.qti.extra.EXTRA_BQR";
-
- /**
* Used as an optional short extra field in {@link #ACTION_FOUND} intents. Contains the RSSI
* value of the remote device as reported by the Bluetooth hardware.
*/
@@ -3359,7 +3351,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
int psm = settings.getL2capPsm();
if (settings.getSocketType() == BluetoothSocket.TYPE_RFCOMM) {
if (settings.getRfcommUuid() == null) {
- throw new IllegalArgumentException("null uuid: " + settings.getRfcommUuid());
+ throw new IllegalArgumentException("null uuid");
}
uuid = new ParcelUuid(settings.getRfcommUuid());
} else if (settings.getSocketType() == BluetoothSocket.TYPE_LE) {
diff --git a/framework/java/android/bluetooth/BluetoothLeBroadcast.java b/framework/java/android/bluetooth/BluetoothLeBroadcast.java
index 85c895fa54..192b95231d 100644
--- a/framework/java/android/bluetooth/BluetoothLeBroadcast.java
+++ b/framework/java/android/bluetooth/BluetoothLeBroadcast.java
@@ -459,7 +459,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
* Callback#onBroadcastStartFailed(int)} will be invoked with reason code.
*
* <p>In particular, when the number of Broadcast Sources reaches {@link
- * #getMaximumNumberOfBroadcast()}, this method will fail with {@link
+ * #getMaximumNumberOfBroadcasts()}, this method will fail with {@link
* BluetoothStatusCodes#ERROR_LOCAL_NOT_ENOUGH_RESOURCES}
*
* <p>After broadcast is started, {@link Callback#onBroadcastMetadataChanged(int,
diff --git a/framework/java/android/bluetooth/BluetoothUtils.java b/framework/java/android/bluetooth/BluetoothUtils.java
index c7aff6aa44..f944a6c57c 100644
--- a/framework/java/android/bluetooth/BluetoothUtils.java
+++ b/framework/java/android/bluetooth/BluetoothUtils.java
@@ -290,7 +290,7 @@ public final class BluetoothUtils {
repl = Integer.toHexString(Byte.toUnsignedInt((byte) arg));
} else {
throw new IllegalArgumentException(
- "Unsupported hex type " + arg.getClass());
+ "Unsupported hex type " + arg.getClass().getSimpleName());
}
}
case '%' -> {
diff --git a/framework/java/android/bluetooth/le/BluetoothLeUtils.java b/framework/java/android/bluetooth/le/BluetoothLeUtils.java
index b1821291fa..8e249394e4 100644
--- a/framework/java/android/bluetooth/le/BluetoothLeUtils.java
+++ b/framework/java/android/bluetooth/le/BluetoothLeUtils.java
@@ -152,9 +152,6 @@ public class BluetoothLeUtils {
/**
* Compares two UUIDs with a UUID mask.
*
- * @param data first {@link #UUID} to compare.
- * @param uuid second {@link #UUID} to compare.
- * @param mask mask {@link #UUID}.
* @return true if both UUIDs are equals when masked, false otherwise.
*/
static boolean maskedEquals(UUID data, UUID uuid, UUID mask) {