Fix Slice not pinned error
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
Loading
Please register or sign in to comment