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

Commit 287fe9d8 authored by William Escande's avatar William Escande
Browse files

ErrorProne: Enforce & fix InlineMeInliner

See https://errorprone.info/bugpattern/InlineMeInliner

Bug: 344658662
Test: m BluetoothInstrumentationTests
Flag: Exempt Build and test only
Change-Id: I8a52c7a69ce019b0a49d9e79131c1c7a87479016
parent b66aedfe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ android_app {
            "-Xep:AlmostJavadoc:ERROR",
            "-Xep:BadImport:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:UnusedMethod:ERROR",
            "-Xep:UnusedVariable:ERROR",
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ java_defaults {
            "-Xep:CatchFail:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
            "-Xep:NonApiType:ERROR",
+4 −8
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import android.os.test.TestLooper;
import android.service.media.MediaBrowserService;
import android.util.Log;

import androidx.test.InstrumentationRegistry;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.uiautomator.UiDevice;

import com.android.bluetooth.avrcpcontroller.BluetoothMediaBrowserService;
@@ -346,16 +346,14 @@ public class TestUtils {
    public static Intent prepareIntentToStartBluetoothBrowserMediaService() {
        final Intent intent =
                new Intent(
                        InstrumentationRegistry.getTargetContext(),
                        InstrumentationRegistry.getInstrumentation().getTargetContext(),
                        BluetoothMediaBrowserService.class);
        intent.setAction(MediaBrowserService.SERVICE_INTERFACE);
        return intent;
    }

    public static void setUpUiTest() throws Exception {
        final UiDevice device =
                UiDevice.getInstance(
                        androidx.test.platform.app.InstrumentationRegistry.getInstrumentation());
        final UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
        // Disable animation
        device.executeShellCommand("settings put global window_animation_scale 0.0");
        device.executeShellCommand("settings put global transition_animation_scale 0.0");
@@ -375,9 +373,7 @@ public class TestUtils {
    }

    public static void tearDownUiTest() throws Exception {
        final UiDevice device =
                UiDevice.getInstance(
                        androidx.test.platform.app.InstrumentationRegistry.getInstrumentation());
        final UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
        device.executeShellCommand("wm dismiss-keyguard");

        // Re-enable animation
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ import android.os.test.TestLooper;
import android.platform.test.flag.junit.FlagsParameterization;
import android.platform.test.flag.junit.SetFlagsRule;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;

import com.android.bluetooth.TestUtils;
import com.android.bluetooth.btservice.ActiveDeviceManager;
@@ -112,7 +112,7 @@ public class A2dpServiceTest {

        TestUtils.mockGetSystemService(
                mAdapterService, Context.AUDIO_SERVICE, AudioManager.class, mAudioManager);
        doReturn(InstrumentationRegistry.getTargetContext().getResources())
        doReturn(InstrumentationRegistry.getInstrumentation().getTargetContext().getResources())
                .when(mAdapterService)
                .getResources();

+4 −3
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@ import android.os.HandlerThread;
import android.os.TestLooperManager;
import android.util.Log;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import com.android.bluetooth.R;
@@ -95,7 +95,8 @@ public class MediaPlayerWrapperTest {
    public void setUp() {

        mTestResources =
                TestUtils.getTestApplicationResources(InstrumentationRegistry.getTargetContext());
                TestUtils.getTestApplicationResources(
                        InstrumentationRegistry.getInstrumentation().getTargetContext());
        mTestBitmap = loadImage(com.android.bluetooth.tests.R.raw.image_200_200);

        when(mMockResources.getBoolean(R.bool.avrcp_target_cover_art_uri_images)).thenReturn(true);
@@ -657,7 +658,7 @@ public class MediaPlayerWrapperTest {

    /*
     * Test to make sure that an error occurs when the MediaController fails to
     * update all its media data in a resonable amount of time.
     * update all its media data in a reasonable amount of time.
     */
    @Test
    public void testMetadataSyncFail() {
Loading