If disconnected bluetooth devices didn't exist in recent devices, the index will return -1. Our condition didn't check this situation, the IndexOutOfBoundsException will throw when this case happens. This CL adds the condition to check whether index is over than or equal 0 to fix IndexOutOfBoundsException. Bug: 173059077 Test: make -j42 RunSettingsRoboTests Change-Id: Id93f4cb6bded83540045c5e8c21c6f6122a39fed
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.