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

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

Enable error prone at build

This allow faster detection of error prone failure

Bug: 344658662
Test: m BluetoothInstrumentationTests
Flag: Exempt Build and test only
Change-Id: Ia94c90b9b178560d14694de30dac53eb7c4dc92c
parent 1bdf1f4b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ android_app {
        "com.android.btservices",
    ],
    errorprone: {
        enabled: true,
        javacflags: [
            // "-Xep:AndroidFrameworkRequiresPermission:ERROR",
            "-Xep:AlmostJavadoc:ERROR",
+8 −0
Original line number Diff line number Diff line
@@ -54,6 +54,14 @@ java_defaults {
        "mts-bluetooth",
    ],

    errorprone: {
        enabled: true,
        javacflags: [
            "-Xep:AlmostJavadoc:ERROR",
            "-Xep:UnusedMethod:ERROR",
        ],
    },

    instrumentation_for: "Bluetooth",
}

+0 −7
Original line number Diff line number Diff line
@@ -81,13 +81,6 @@ public class CoverArtTest {
        return BitmapFactory.decodeStream(imageInputStream);
    }

    private InputStream toInputSteam(Bitmap bitmap) {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.PNG, 0, outputStream);
        byte[] imageBytes = outputStream.toByteArray();
        return new ByteArrayInputStream(imageBytes);
    }

    private Bitmap toBitmap(byte[] imageBytes) {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(imageBytes);
        return BitmapFactory.decodeStream(inputStream);
+0 −9
Original line number Diff line number Diff line
@@ -394,15 +394,6 @@ public class AdapterServiceTest {
        }
    }

    private static void verifyStateChange(
            IBluetoothCallback cb, int prevState, int currState, int timeoutMs) {
        try {
            verify(cb, timeout(timeoutMs)).onBluetoothStateChange(prevState, currState);
        } catch (RemoteException e) {
            // the mocked onBluetoothStateChange doesn't throw RemoteException
        }
    }

    private static void verifyStateChange(IBluetoothCallback cb, int prevState, int currState) {
        try {
            verify(cb).onBluetoothStateChange(prevState, currState);
+0 −16
Original line number Diff line number Diff line
@@ -170,20 +170,4 @@ public class BluetoothOppBtEnablingActivityTest {
        Thread.sleep(3_000);
        assertThat(activityScenario.getState()).isEqualTo(state);
    }

    private void enableActivity(boolean enable) {
        int enabledState =
                enable ? COMPONENT_ENABLED_STATE_ENABLED : COMPONENT_ENABLED_STATE_DEFAULT;

        mTargetContext
                .getPackageManager()
                .setApplicationEnabledSetting(
                        mTargetContext.getPackageName(), enabledState, DONT_KILL_APP);

        ComponentName activityName =
                new ComponentName(mTargetContext, BluetoothOppTransferActivity.class);
        mTargetContext
                .getPackageManager()
                .setComponentEnabledSetting(activityName, enabledState, DONT_KILL_APP);
    }
}
Loading