Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 73afb042 authored by Jason Chiu's avatar Jason Chiu
Browse files

Workaround of Slice not pinned bug when using SliceCallback

When a client registers a SliceCallback, it starts to observe Slice
changes. The observer is running in the main looper and binds Slice
in AsyncTask.

However, when the client unregisters the callback, it unpins the Slice
in the client's thread. Thus, if the AsyncTask has pinned the slice but
hasn't bound it yet, it may be unpinned by the client, and an exception
occurs.

This fix is to unpin the Slice in the same SerialExecutor of AsyncTask,
which is to ensure bindSlice() and unpinSlice() are called in the same
thread one after another without the race condition.

Bug: 157387583
Test: robotest
Change-Id: If5f4b4bc0d8c5a2800cad8ff2afd7084426a6c96
parent 02e311e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment