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

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

SystemService: Fix lint error "UseValueOf"

Bug: 262605980
Test: m service-bluetooth
Test: atest ServiceBluetoothTests
Change-Id: I02076bf87c909d73e5da5b744e3af520f5e9fd94
parent d6cbbd35
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
        message="This method should only be accessed from tests or within private scope">
        <location
            file="packages/modules/Bluetooth/service/src/com/android/server/bluetooth/BluetoothManagerService.java"
            line="1533"/>
            line="1532"/>
    </issue>

    <issue
@@ -49,20 +49,4 @@
            line="51"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Integer.valueOf(bluetoothProfile)` instead">
        <location
            file="packages/modules/Bluetooth/service/src/com/android/server/bluetooth/BluetoothManagerService.java"
            line="1451"/>
    </issue>

    <issue
        id="UseValueOf"
        message="Use `Integer.valueOf(bluetoothProfile)` instead">
        <location
            file="packages/modules/Bluetooth/service/src/com/android/server/bluetooth/BluetoothManagerService.java"
            line="1466"/>
    </issue>

</issues>
+4 −5
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ class BluetoothManagerService {
                                + ", not in supported profiles list");
                return false;
            }
            ProfileServiceConnections psc = mProfileServices.get(Integer.valueOf(bluetoothProfile));
            ProfileServiceConnections psc = mProfileServices.get(bluetoothProfile);
            if (psc == null) {
                if (DBG) {
                    Log.d(
@@ -1448,7 +1448,7 @@ class BluetoothManagerService {
                    return false;
                }

                mProfileServices.put(new Integer(bluetoothProfile), psc);
                mProfileServices.put(bluetoothProfile, psc);
            }
        }

@@ -1463,8 +1463,7 @@ class BluetoothManagerService {
    void unbindBluetoothProfileService(
            int bluetoothProfile, IBluetoothProfileServiceConnection proxy) {
        synchronized (mProfileServices) {
            Integer profile = new Integer(bluetoothProfile);
            ProfileServiceConnections psc = mProfileServices.get(profile);
            ProfileServiceConnections psc = mProfileServices.get(bluetoothProfile);
            if (psc == null) {
                return;
            }
@@ -1477,7 +1476,7 @@ class BluetoothManagerService {
                    Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e);
                }
                if (!mUnbindingAll) {
                    mProfileServices.remove(profile);
                    mProfileServices.remove(bluetoothProfile);
                }
            }
        }