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

Commit bbe16831 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge "BluetoothInstrumentationTests: Enforce UnusedVariable errorprone" into main

parents 479d45cc b1a87d7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,7 @@ java_defaults {
            "-Xep:UnnecessaryAssignment:ERROR",
            "-Xep:UnnecessaryAssignment:ERROR",
            "-Xep:UnnecessaryAsync:ERROR",
            "-Xep:UnnecessaryAsync:ERROR",
            "-Xep:UnusedMethod:ERROR",
            "-Xep:UnusedMethod:ERROR",
            "-Xep:UnusedVariable:ERROR",
        ],
        ],
    },
    },


+0 −2
Original line number Original line Diff line number Diff line
@@ -57,8 +57,6 @@ import java.util.stream.IntStream;


/** A set of methods useful in Bluetooth instrumentation tests */
/** A set of methods useful in Bluetooth instrumentation tests */
public class TestUtils {
public class TestUtils {
    private static final int SERVICE_TOGGLE_TIMEOUT_MS = 1000; // 1s

    private static String sSystemScreenOffTimeout = "10000";
    private static String sSystemScreenOffTimeout = "10000";


    private static final String TAG = "BluetoothTestUtils";
    private static final String TAG = "BluetoothTestUtils";
+0 −4
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@ import java.util.Arrays;
@RunWith(AndroidJUnit4.class)
@RunWith(AndroidJUnit4.class)
public class A2dpCodecConfigTest {
public class A2dpCodecConfigTest {


    private Context mTargetContext;
    private BluetoothDevice mTestDevice;
    private BluetoothDevice mTestDevice;
    private A2dpCodecConfig mA2dpCodecConfig;
    private A2dpCodecConfig mA2dpCodecConfig;


@@ -72,7 +71,6 @@ public class A2dpCodecConfigTest {
    private static final int APTX_PRIORITY_DEFAULT = 5001;
    private static final int APTX_PRIORITY_DEFAULT = 5001;
    private static final int APTX_HD_PRIORITY_DEFAULT = 7001;
    private static final int APTX_HD_PRIORITY_DEFAULT = 7001;
    private static final int LDAC_PRIORITY_DEFAULT = 9001;
    private static final int LDAC_PRIORITY_DEFAULT = 9001;
    private static final int LC3_PRIORITY_DEFAULT = 11001;
    private static final int OPUS_PRIORITY_DEFAULT = 13001;
    private static final int OPUS_PRIORITY_DEFAULT = 13001;
    private static final int PRIORITY_HIGH = 1000000;
    private static final int PRIORITY_HIGH = 1000000;


@@ -214,8 +212,6 @@ public class A2dpCodecConfigTest {


    @Before
    @Before
    public void setUp() throws Exception {
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();

        when(mMockContext.getResources()).thenReturn(mMockResources);
        when(mMockContext.getResources()).thenReturn(mMockResources);
        when(mMockResources.getInteger(R.integer.a2dp_source_codec_priority_sbc))
        when(mMockResources.getInteger(R.integer.a2dp_source_codec_priority_sbc))
                .thenReturn(SBC_PRIORITY_DEFAULT);
                .thenReturn(SBC_PRIORITY_DEFAULT);
+0 −2
Original line number Original line Diff line number Diff line
@@ -56,7 +56,6 @@ import java.util.Arrays;
@RunWith(AndroidJUnit4.class)
@RunWith(AndroidJUnit4.class)
public class A2dpStateMachineTest {
public class A2dpStateMachineTest {
    private BluetoothAdapter mAdapter;
    private BluetoothAdapter mAdapter;
    private Context mTargetContext;
    private HandlerThread mHandlerThread;
    private HandlerThread mHandlerThread;
    private A2dpStateMachine mA2dpStateMachine;
    private A2dpStateMachine mA2dpStateMachine;
    private BluetoothDevice mTestDevice;
    private BluetoothDevice mTestDevice;
@@ -76,7 +75,6 @@ public class A2dpStateMachineTest {


    @Before
    @Before
    public void setUp() throws Exception {
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();
        doReturn(mActiveDeviceManager).when(mAdapterService).getActiveDeviceManager();
        doReturn(mActiveDeviceManager).when(mAdapterService).getActiveDeviceManager();
        doReturn(mSilenceDeviceManager).when(mAdapterService).getSilenceDeviceManager();
        doReturn(mSilenceDeviceManager).when(mAdapterService).getSilenceDeviceManager();


+0 −3
Original line number Original line Diff line number Diff line
@@ -58,13 +58,10 @@ public class A2dpSinkStateMachineTest {
    private A2dpSinkStateMachine mStateMachine;
    private A2dpSinkStateMachine mStateMachine;
    private BluetoothAdapter mAdapter;
    private BluetoothAdapter mAdapter;
    private BluetoothDevice mDevice;
    private BluetoothDevice mDevice;
    private Context mTargetContext;
    private TestLooper mLooper;
    private TestLooper mLooper;


    @Before
    @Before
    public void setUp() throws Exception {
    public void setUp() throws Exception {
        mTargetContext = InstrumentationRegistry.getTargetContext();

        mLooper = new TestLooper();
        mLooper = new TestLooper();


        mAdapter = BluetoothAdapter.getDefaultAdapter();
        mAdapter = BluetoothAdapter.getDefaultAdapter();
Loading