Use flushIfNeeded when adding/removing frozen callbacks
Previously removeFrozenStateChangeCallback calls flushCommands which causes an extra decStrong occasionally. A temporary fix was merged in ag/34929528 to stop calling flushCommands, which has the potential downside of commands never executed if the thread is closed, leading to binder ref leak. This change provides a more proper fix - still flush when it's safe to do so, but when we are in the situation where double decStrong is an issue, i.e. when on a looper thread, defer flush until later. Flag: build.RELEASE_LIBBINDER_FREEZE_USE_FLUSH_IF_NEEDED Bug: 430341301 Test: atest binderLibTest Change-Id: Ib2a831178bd1d2a7d9753620e2e73b04c7273dbb
Loading
Please register or sign in to comment