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

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

ErrorProne: Enforce & fix EmptyCatch

Bug: 344658662
Test: m BluetoothInstrumentationTests
Flag: Exempt Build and test only
Change-Id: Ib1228c7419d37cc3e081ad74de4a299b46146459
parent b7e05cca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ java_defaults {
        enabled: true,
        javacflags: [
            "-Xep:AlmostJavadoc:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
            "-Xep:UnnecessaryAsync:ERROR",
            "-Xep:UnusedMethod:ERROR",
+2 −0
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ public class TestUtils {
                    try {
                        wait();
                    } catch (InterruptedException e) {
                        Log.w(TAG, "waitForIdle got interrupted", e);
                    }
                }
            }
@@ -454,6 +455,7 @@ public class TestUtils {
                    try {
                        wait();
                    } catch (InterruptedException e) {
                        Log.w(TAG, "waitForComplete got interrupted", e);
                    }
                }
            }
+3 −0
Original line number Diff line number Diff line
@@ -90,8 +90,11 @@ java_sdk_library {
    errorprone: {
        javacflags: [
            "-Xep:InlineMeSuggester:OFF", // The @InlineMe annotation is not available

            "-Xep:EmptyCatch:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
            "-Xep:UnnecessaryAsync:ERROR",

            "-XepExcludedPaths:.*/srcjars/.*", // Exclude generated files
        ],
        enabled: true,
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ java_defaults {
            "-Xep:AlreadyChecked:ERROR",
            "-Xep:CheckReturnValue:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EqualsIncompatibleType:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
            "-Xep:ReferenceEquality:ERROR",
+2 −1
Original line number Diff line number Diff line
@@ -912,9 +912,10 @@ class BluetoothManagerService {
                            mContentResolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE)
                    != 0;
        } catch (SettingNotFoundException e) {
        }
            // The settings is considered as false by default.
            return false;
        }
    }

    boolean isHearingAidProfileSupported() {
        return mIsHearingAidProfileSupported;