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

Commit 78da0ec6 authored by Yu-Ting Tseng's avatar Yu-Ting Tseng
Browse files

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
parent db4eb5e3
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