Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2c264c3 authored by William Escande's avatar William Escande
Browse files

ErrorProne: Enforce & fix InvalidParam

See https://errorprone.info/bugpattern/InvalidParam

Bug: 344658662
Test: m BluetoothInstrumentationTests
Flag: Exempt Build and test only
Change-Id: I6be5e43ea7c905e2d64a9c58a9bfa75e131a444b
parent d0b2d92e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ android_app {
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidParam:ERROR",
            "-Xep:MockNotUsedInProduction:ERROR",
            "-Xep:ReturnAtTheEndOfVoidFunction:ERROR",
            "-Xep:UnusedMethod:ERROR",
+1 −1
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ class AvrcpPlayer {
        /**
         * Set the entire set of supported features for this Player.
         *
         * @param features The feature set for this player, defined in AVRCP 6.10.2.1
         * @param supportedFeatures The feature set for this player, defined in AVRCP 6.10.2.1
         * @return This object, so you can continue building
         */
        public Builder setSupportedFeatures(byte[] supportedFeatures) {
+1 −11
Original line number Diff line number Diff line
@@ -446,16 +446,6 @@ public class AdapterService extends Service {
        mHandler.sendMessage(m);
    }

    /**
     * Confirm whether the ProfileService is started expectedly.
     *
     * @param serviceSampleName the service simple name.
     * @return true if the service is started expectedly, false otherwise.
     */
    public boolean isStartedProfile(int profileId) {
        return mStartedProfiles.containsKey(profileId);
    }

    class AdapterServiceHandler extends Handler {
        AdapterServiceHandler(Looper looper) {
            super(looper);
@@ -1190,7 +1180,7 @@ public class AdapterService extends Service {
        // Disable the non-supported profiles service
        for (int profileId : nonSupportedProfiles) {
            Config.setProfileEnabled(profileId, false);
            if (isStartedProfile(profileId)) {
            if (mStartedProfiles.containsKey(profileId)) {
                setProfileServiceState(profileId, BluetoothAdapter.STATE_OFF);
            }
        }
+0 −1
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ public class AudioRoutingManager extends ActiveDeviceManager {
     *
     * @param device The device to be activated.
     * @param profile The profile to be activated
     * @param receiver to post the results
     */
    public CompletableFuture<Boolean> activateDeviceProfile(BluetoothDevice device, int profile) {
        CompletableFuture<Boolean> future = new CompletableFuture<>();
+1 −8
Original line number Diff line number Diff line
@@ -115,14 +115,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
    public static final String TYPE_EMAIL_STR = "EMAIL";
    public static final String TYPE_IM_STR = "IM";

    /**
     * Create a e-mail MAS instance
     *
     * @param callback
     * @param context
     * @param mns
     * @param emailBaseUri - use null to create a SMS/MMS MAS instance
     */
    /** Create a e-mail MAS instance */
    public BluetoothMapMasInstance(
            BluetoothMapService mapService,
            Context context,
Loading