If job has been stopped by any reason, we should cancel the background thread, otherwise it will throw SecurityException when dequeuing from JobParams. This CL adds a lock to synchronize the method and stops dequeue work if job has been canceled. Change-Id: I7732b7f7d444a55a4b4ba6645cd2c16b6f840a6c Merged-In: I7732b7f7d444a55a4b4ba6645cd2c16b6f840a6c Fixes: 77968649 Test: RunSettingsRoboTests
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.