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

Commit 8c68a4d9 authored by John Wu's avatar John Wu
Browse files

Do not do heapSweep on message removal

When push or quit is called between a heapSweap call and a removeMessage
call, the existing implementation is broken because it will call
heapSweap, making the removed message being re-added back to
MessageHeap, causing duplicates.

Also, stop comparing m against mTopValue, and instead directly check if
m.prev is null to determine whether an add/remove race occurred, since
the existing implementation does not take into account when pushes or
quits are called after the previous heapSweap.

Bug: 433901686
Test: atest FrameworksCoreTestsRavenwood:android.os.MessageStackTest
Flag: EXEMPT new data structure isn't used yet; usages will be flagged
Change-Id: Icd315ec277d72ada38b671757e6cce3886ea3ce9
parent abdefbe6
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