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

Commit 92f40563 authored by William Escande's avatar William Escande
Browse files

Enforce lint UseValueOf and fix usages

Bug: 289445022
Test: m Bluetooth
Change-Id: Ibd7ee399eca9fa4e735e72f9ddb38b5d1b338ad3
parent d5e42c20
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ android_app {
            "ObsoleteSdkInt",
            "Recycle",
            "UseSparseArrays",
            "UseValueOf",
        ],
        strict_updatability_linting: true,
    },
+0 −72
Original line number Diff line number Diff line
@@ -5679,78 +5679,6 @@
            line="506"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Integer.valueOf(arg)` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java"
            line="1958"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Integer.valueOf(bufferSize)` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/hid/HidDeviceService.java"
            line="900"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Long.valueOf(Instant.now().toEpochMilli())` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mapclient/MceStateMachine.java"
            line="758"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Long.valueOf(millisecondsToMcsInterval(positionMs))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="620"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Long.valueOf(mcsIntervalToMilliseconds(intVal))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="1202"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Float.valueOf(64 * Math.log(speed) / Math.log(2))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="1772"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Float.valueOf(Math.pow(2, (speed.floatValue() / 64.0f)))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="1776"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Long.valueOf(millisecondsToMcsInterval(positionMs))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="1866"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Long.valueOf(millisecondsToMcsInterval(durationMs))` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/mcp/MediaControlGattService.java"
            line="1908"/>
    </issue>

    <issue
        id="TypographyEllipsis"
        message="Replace &quot;...&quot; with ellipsis character (…, &amp;#8230;) ?">
+1 −1
Original line number Diff line number Diff line
@@ -1955,7 +1955,7 @@ public class HeadsetStateMachine extends StateMachine {

            String arg = input.substring(i, j);
            try {
                out.add(new Integer(arg));
                out.add(Integer.valueOf(arg));
            } catch (NumberFormatException e) {
                out.add(arg);
            }
+1 −1
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ public class HidDeviceService extends ProfileService {
        }

        Message msg = mHandler.obtainMessage(MESSAGE_GET_REPORT);
        msg.obj = bufferSize > 0 ? new Integer(bufferSize) : null;
        msg.obj = bufferSize > 0 ? Integer.valueOf(bufferSize) : null;
        msg.arg1 = type;
        msg.arg2 = id;
        mHandler.sendMessage(msg);
+1 −1
Original line number Diff line number Diff line
@@ -755,7 +755,7 @@ class MceStateMachine extends StateMachine {
                        if (timestamp == null) {
                            // Infer the timestamp for this message as 'now' and read status
                            // false instead of getting the message listing data for it
                            timestamp = new Long(Instant.now().toEpochMilli());
                            timestamp = Instant.now().toEpochMilli();
                        }
                        MessageMetadata metadata = new MessageMetadata(event.getHandle(),
                                timestamp, false, MESSAGE_NOT_SEEN);
Loading