Slices should be pinned before being bound. The original design calls registerSliceCallback() to pin a slice, and then calls bindSlice() and passes the result to the callback directly. When the callback is called, it executes unregisterSliceCallback() and unpins the slice. However, registerSliceCallback() starts to observe the slice change and then rebind it in an AsyncTask. If the slice is updating via its background worker and the timing of the binding overlaps the callback execution, it's possible to bind the slice right after unpinning it and causes the error. The solution is to remove the callback mechanism, and just to pin, bind and unpin the slice directly. Fixes: 157387583 Test: robotest Change-Id: I8748dd3038a3662599935f07420d07cf254a4073
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.