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
Loading
Please register or sign in to comment