Loading android/app/tests/unit/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -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", ], ], }, }, Loading android/app/tests/unit/src/com/android/bluetooth/TestUtils.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -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"; Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading android/app/tests/unit/src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachineTest.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -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 Loading
android/app/tests/unit/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -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", ], ], }, }, Loading
android/app/tests/unit/src/com/android/bluetooth/TestUtils.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -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"; Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpStateMachineTest.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachineTest.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -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