diff options
author | 2025-02-26 17:43:01 -0800 | |
---|---|---|
committer | 2025-03-06 15:48:23 -0800 | |
commit | 1559299072f15a0a4592477bb6fb4c63967fc8d7 (patch) | |
tree | db9a1ae22d8f29c94b3275077eaad9f24e02fb7a | |
parent | 0bbbac4b68b37c6f2a47ff6e3ab62258a877e8a0 (diff) |
Errorprone enforce multiples
I did my shopping list of errorprone that only appear as warning and are
note enforced yet. I am promoting them to error to make sure this will
never happen
Bug: 344658662
Test: m .
Flag: Exempt refactor
Change-Id: I7a4e73c92a094d14fc12c1a801d6fb5fb386ae6c
15 files changed, 70 insertions, 71 deletions
diff --git a/Android.bp b/Android.bp index 89fa45ba46..34d17b71f2 100644 --- a/Android.bp +++ b/Android.bp @@ -121,8 +121,11 @@ java_defaults { javacflags: [ "-Xep:AlmostJavadoc:ERROR", "-Xep:AlreadyChecked:ERROR", + "-Xep:AmbiguousMethodReference:ERROR", "-Xep:ArrayRecordComponent:ERROR", + "-Xep:AttemptedNegativeZero:ERROR", "-Xep:BadImport:ERROR", + "-Xep:BadInstanceof:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchFail:ERROR", "-Xep:CheckReturnValue:ERROR", @@ -146,11 +149,14 @@ java_defaults { "-Xep:GuardedBy:ERROR", "-Xep:HidingField:ERROR", "-Xep:InconsistentHashCode:ERROR", + "-Xep:IncrementInForLoopAndHeader:ERROR", "-Xep:InlineFormatString:ERROR", "-Xep:InlineMeInliner:ERROR", "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", + "-Xep:InvalidLink:ERROR", "-Xep:InvalidParam:ERROR", + "-Xep:JavaLangClash:ERROR", "-Xep:JavaUtilDate:ERROR", "-Xep:JdkObsolete:ERROR", "-Xep:LockOnNonEnclosingClassLiteral:ERROR", @@ -168,9 +174,12 @@ java_defaults { "-Xep:NonAtomicVolatileUpdate:ERROR", "-Xep:NonCanonicalType:ERROR", "-Xep:NotJavadoc:ERROR", + "-Xep:NullOptional:ERROR", + "-Xep:NullableOptional:ERROR", "-Xep:NullablePrimitive:ERROR", "-Xep:NullableVoid:ERROR", "-Xep:ObjectEqualsForPrimitives:ERROR", + // "-Xep:ObjectToString:ERROR", // Wrongfully reporting errors "-Xep:OperatorPrecedence:ERROR", "-Xep:RedundantControlFlow:ERROR", "-Xep:ReferenceEquality:ERROR", @@ -181,10 +190,13 @@ java_defaults { "-Xep:StaticGuardedByInstance:ERROR", "-Xep:StringCaseLocaleUsage:ERROR", "-Xep:StringCharset:ERROR", + // "-Xep:StringSplitter:ERROR", // Not enabled in android platform "-Xep:SynchronizeOnNonFinalField:ERROR", "-Xep:ThreadJoinLoop:ERROR", "-Xep:ToStringReturnsNull:ERROR", + "-Xep:TruthAssertExpected:ERROR", "-Xep:TruthConstantAsserts:ERROR", + "-Xep:TruthGetOrDefault:ERROR", "-Xep:TruthIncompatibleType:ERROR", "-Xep:UndefinedEquals:ERROR", "-Xep:UnnecessaryAssignment:ERROR", @@ -193,6 +205,7 @@ java_defaults { "-Xep:UnrecognisedJavadocTag:ERROR", "-Xep:UnusedMethod:ERROR", "-Xep:UnusedNestedClass:ERROR", + "-Xep:UnusedTypeParameter:ERROR", "-Xep:UnusedVariable:ERROR", "-Xep:VariableNameSameAsType:ERROR", "-Xep:WaitNotInLoop:ERROR", diff --git a/android/app/src/com/android/bluetooth/ObexServerSockets.java b/android/app/src/com/android/bluetooth/ObexServerSockets.java index 712049d561..0294ff3e05 100644 --- a/android/app/src/com/android/bluetooth/ObexServerSockets.java +++ b/android/app/src/com/android/bluetooth/ObexServerSockets.java @@ -29,7 +29,7 @@ import java.io.IOException; /** * Wraps multiple BluetoothServerSocket objects to make it possible to accept connections on both a * RFCOMM and L2CAP channel in parallel.<br> - * Create an instance using {@link #create()}, which will block until the sockets have been created + * Create an instance using {@link #create}, which will block until the sockets have been created * and channel numbers have been assigned.<br> * Use {@link #getRfcommChannel()} and {@link #getL2capPsm()} to get the channel numbers to put into * the SDP record.<br> diff --git a/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java b/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java index d592a36481..17908cf61c 100644 --- a/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java +++ b/android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java @@ -347,12 +347,12 @@ public class MediaPlayerList { return id; } - /** Returns the {@link #MediaPlayerWrapper} with ID matching {@link #mActivePlayerId}. */ + /** Returns the {@link MediaPlayerWrapper} with ID matching {@link #mActivePlayerId}. */ public MediaPlayerWrapper getActivePlayer() { return mMediaPlayers.get(mActivePlayerId); } - /** Returns the {@link #MediaPlayerWrapper} with ID matching {@link #mAddressedPlayerId}. */ + /** Returns the {@link MediaPlayerWrapper} with ID matching {@link #mAddressedPlayerId}. */ public MediaPlayerWrapper getAddressedPlayer() { return mMediaPlayers.get(mAddressedPlayerId); } @@ -1009,7 +1009,7 @@ public class MediaPlayerList { * Sets {@code playerId} as the new active player and sends the new player's {@link Mediadata} * to the AVRCP service. * - * <p>Also informs the {@link #PlayerSettingsManager} about the change of active player. + * <p>Also informs the {@link PlayerSettingsManager} about the change of active player. */ void setActivePlayer(int playerId) { if (!haveMediaPlayer(playerId)) { @@ -1113,7 +1113,8 @@ public class MediaPlayerList { * <p>Note: This does not set the current active player, only adds the new {@link * MediaController} to the {@link #mMediaPlayerIds} and {@link mMediaPlayers} maps. * - * <p>See {@link #onMediaKeyEventSessionChanged}. + * <p>See {@link + * MediaSessionManager.OnMediaKeyEventSessionChangedListener#onMediaKeyEventSessionChanged}. */ @VisibleForTesting final MediaSessionManager.OnActiveSessionsChangedListener mActiveSessionsChangedListener = @@ -1291,7 +1292,7 @@ public class MediaPlayerList { /** * Saves the reference to {@link MediaPlayerSettingsEventListener} to be called when the active - * player changed, so that {@link #PlayerSettingsManager} always has the right player. + * player changed, so that {@link PlayerSettingsManager} always has the right player. */ void setPlayerSettingsCallback(MediaPlayerSettingsEventListener listener) { mPlayerSettingsListener = listener; @@ -1340,10 +1341,12 @@ public class MediaPlayerList { /** * Callback from {@link MediaPlayerWrapper}. * - * <p>{@link #mediaUpdatedCallback} listens for {@link #MediaData} changes on the active player. + * <p>{@link MediaPlayerWrapper.Callback#mediaUpdatedCallback} listens for {@link MediaData} + * changes on the active player. * - * <p>{@link #sessionUpdatedCallback} is called when the active session is destroyed so we need - * to remove the media player from the {@link #mMediaPlayerIds} and {@link mMediaPlayers} maps. + * <p>{@link MediaPlayerWrapper.Callback#sessionUpdatedCallback} is called when the active + * session is destroyed so we need to remove the media player from the {@link #mMediaPlayerIds} + * and {@link mMediaPlayers} maps. */ private final MediaPlayerWrapper.Callback mMediaPlayerCallback = new MediaPlayerWrapper.Callback() { diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapAppParams.java b/android/app/src/com/android/bluetooth/map/BluetoothMapAppParams.java index fb7477b8e4..71342f0e29 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapAppParams.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapAppParams.java @@ -188,14 +188,14 @@ public class BluetoothMapAppParams { /** * Creates an application parameter object based on a application parameter OBEX header. The - * content of the {@link appParam} byte array will be parsed, and its content will be stored in + * content of the {@code appParams} byte array will be parsed, and its content will be stored in * the member variables. {@link INVALID_VALUE_PARAMETER} can be used to determine if a value is - * set or not, where strings will be empty, if {@link appParam} did not contain the parameter. + * set or not, where strings will be empty, if {@code appParams} did not contain the parameter. * * @param appParams the byte array containing the application parameters OBEX header * @throws IllegalArgumentException when a parameter does not respect the valid ranges specified * in the MAP spec. - * @throws ParseException if a parameter string if formated incorrectly. + * @throws ParseException if a parameter string if formatted incorrectly. */ public BluetoothMapAppParams(final byte[] appParams) throws IllegalArgumentException, ParseException { @@ -208,7 +208,7 @@ public class BluetoothMapAppParams { * @param appParams the byte array containing the application parameters OBEX header * @throws IllegalArgumentException when a parameter does not respect the valid ranges specified * in the MAP spec. - * @throws ParseException if a parameter string if formated incorrectly. + * @throws ParseException if a parameter string if formatted incorrectly. */ private void parseParams(final byte[] appParams) throws ParseException, IllegalArgumentException { diff --git a/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java b/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java index d8441226a8..99ed3c709c 100644 --- a/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java +++ b/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java @@ -3818,7 +3818,7 @@ public class BluetoothMapContent { } /** - * Read out the mms parts and update the bMessage object provided i {@linkplain message} + * Read out the mms parts and update the bMessage object provided i {@code message} * * @param id the content provider ID of the message * @param message the bMessage object to add the information to diff --git a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java index 7b898c389e..ff18ff4b8e 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java @@ -348,7 +348,7 @@ public class LeAudioServiceTest { doReturn(bondState).when(mAdapterService).getBondState(device); when(mDatabaseManager.getProfileConnectionPolicy(device, BluetoothProfile.LE_AUDIO)) .thenReturn(priority); - assertThat(expected).isEqualTo(mService.okToConnect(device)); + assertThat(mService.okToConnect(device)).isEqualTo(expected); } /** Test okToConnect method using various test cases */ diff --git a/android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java b/android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java index db55624516..73280280ca 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/mapclient/MapClientStateMachineTest.java @@ -768,8 +768,8 @@ public class MapClientStateMachineTest { /** * Preconditions: - In {@code STATE_CONNECTED}. * - * <p>Actions: - {@link #sendMapMessage} with 'Sent' {@link PendingIntents}. - {@link - * #receiveEvent} of type {@link SENDING_SUCCESS}. + * <p>Actions: - {@link MceStateMachine#sendMapMessage} with 'Sent' {@link PendingIntents}. - + * {@link MceStateMachine#receiveEvent} of type {@link SENDING_SUCCESS}. * * <p>Outcome: - SENT_STATUS Intent was broadcast with 'Success' result code. */ @@ -785,8 +785,8 @@ public class MapClientStateMachineTest { /** * Preconditions: - In {@code STATE_CONNECTED}. * - * <p>Actions: - {@link #sendMapMessage} with 'Delivery' {@link PendingIntents}. - {@link - * #receiveEvent} of type {@link DELIVERY_SUCCESS}. + * <p>Actions: - {@link MceStateMachine#sendMapMessage} with 'Delivery' {@link PendingIntents}. + * - {@link MceStateMachine#receiveEvent} of type {@link DELIVERY_SUCCESS}. * * <p>Outcome: - DELIVERY_STATUS Intent was broadcast with 'Success' result code. */ @@ -802,9 +802,9 @@ public class MapClientStateMachineTest { /** * Preconditions: - In {@code STATE_CONNECTED}. * - * <p>Actions: - {@link #sendMapMessage} with 'null' {@link PendingIntents}. - {@link - * #receiveEvent} of type {@link SENDING_SUCCESS}. - {@link #receiveEvent} of type {@link - * DELIVERY_SUCCESS}. + * <p>Actions: - {@link MceStateMachine#sendMapMessage} with 'null' {@link PendingIntents}. - + * {@link MceStateMachine#receiveEvent} of type {@link SENDING_SUCCESS}. - {@link + * MceStateMachine#receiveEvent} of type {@link DELIVERY_SUCCESS}. * * <p>Outcome: - No Intent was broadcast. */ @@ -818,8 +818,8 @@ public class MapClientStateMachineTest { /** * Preconditions: - In {@code STATE_CONNECTED}. * - * <p>Actions: - {@link #sendMapMessage} with 'Sent' {@link PendingIntents}. - {@link - * #receiveEvent} of type {@link SENDING_FAILURE}. + * <p>Actions: - {@link MceStateMachine#sendMapMessage} with 'Sent' {@link PendingIntents}. - + * {@link MceStateMachine#receiveEvent} of type {@link SENDING_FAILURE}. * * <p>Outcome: - SENT_STATUS Intent was broadcast with 'Failure' result code. */ @@ -837,8 +837,8 @@ public class MapClientStateMachineTest { /** * Preconditions: - In {@code STATE_CONNECTED}. * - * <p>Actions: - {@link #sendMapMessage} with 'Delivery' {@link PendingIntents}. - {@link - * #receiveEvent} of type {@link DELIVERY_FAILURE}. + * <p>Actions: - {@link MceStateMachine#sendMapMessage} with 'Delivery' {@link PendingIntents}. + * - {@link MceStateMachine#receiveEvent} of type {@link DELIVERY_FAILURE}. * * <p>Outcome: - DELIVERY_STATUS Intent was broadcast with 'Failure' result code. */ 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) { |