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

Commit 5431f6b3 authored by William Escande's avatar William Escande
Browse files

Enforce lint ObsoleteSdkInt and fix usages

Bug: 289445022
Test: m Bluetooth
Change-Id: I35a3a46f85f7a66d46462b1d983f3472e4314ac2
parent 1a402ad3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ android_app {
        error_checks: [
            "ExtraText",
            "NewApi",
            "ObsoleteSdkInt",
            "Recycle",
        ],
        strict_updatability_linting: true,
+11 −59
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@
        message="Implicitly using the default locale is a common source of bugs: Use `String.format(Locale, ...)` instead">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java"
            line="145"/>
            line="144"/>
    </issue>

    <issue
@@ -110,7 +110,7 @@
        message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`.">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java"
            line="3765"/>
            line="3764"/>
    </issue>

    <issue
@@ -118,7 +118,7 @@
        message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`.">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java"
            line="3070"/>
            line="3069"/>
    </issue>

    <issue
@@ -126,7 +126,7 @@
        message="Implicitly using the default locale is a common source of bugs: Use `toUpperCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`.">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java"
            line="3112"/>
            line="3111"/>
    </issue>

    <issue
@@ -4446,7 +4446,7 @@
        message="This method should only be accessed from tests or within private scope">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="645"/>
            line="644"/>
    </issue>

    <issue
@@ -4454,7 +4454,7 @@
        message="This method should only be accessed from tests or within private scope">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="646"/>
            line="645"/>
    </issue>

    <issue
@@ -4462,7 +4462,7 @@
        message="This method should only be accessed from tests or within private scope">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="669"/>
            line="668"/>
    </issue>

    <issue
@@ -4470,7 +4470,7 @@
        message="This method should only be accessed from tests or within private scope">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="670"/>
            line="669"/>
    </issue>

    <issue
@@ -5524,7 +5524,7 @@
        message="Provide a timeout when requesting a wakelock with `PowerManager.Wakelock.acquire(long timeout)`. This will ensure the OS will cleanup any wakelocks that last longer than you intend, and will save your user&apos;s battery.">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="290"/>
            line="289"/>
    </issue>

    <issue
@@ -5532,55 +5532,7 @@
        message="Provide a timeout when requesting a wakelock with `PowerManager.Wakelock.acquire(long timeout)`. This will ensure the OS will cleanup any wakelocks that last longer than you intend, and will save your user&apos;s battery.">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="490"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 19">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContent.java"
            line="63"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 19">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/BluetoothMapContentObserver.java"
            line="85"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 19">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/MmsFileProvider.java"
            line="40"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 5">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="46"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 19">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/map/SmsMmsContacts.java"
            line="40"/>
    </issue>

    <issue
        id="ObsoleteSdkInt"
        message="Unnecessary; SDK_INT is always >= 33">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/Utils.java"
            line="426"/>
            line="489"/>
    </issue>

    <issue
@@ -5716,7 +5668,7 @@
        message="This `Handler` class should be static or leaks might occur (anonymous android.os.Handler)">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/sap/SapService.java"
            line="450"/>
            line="449"/>
    </issue>

    <issue
+0 −1
Original line number Diff line number Diff line
@@ -423,7 +423,6 @@ public final class Utils {
     * @return the list of AssociationInfo objects
     */
    @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES")
    @RequiresApi(Build.VERSION_CODES.TIRAMISU)
    // TODO(b/193460475): Android Lint handles change from SystemApi to public incorrectly.
    // CompanionDeviceManager#getAllAssociations() is public in U,
    // but existed in T as an identical SystemApi.
+0 −1
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

@TargetApi(19)
public class BluetoothMapContent {

    private static final String TAG = "BluetoothMapContent";
+0 −1
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;

@TargetApi(19)
public class BluetoothMapContentObserver {
    private static final String TAG = "BluetoothMapContentObserver";

Loading