[Memory Improvement] Drop non existing items in mAdded lists
New items are added to mAddedItems whenever setData is called. This can happen regardless of whether messaging layouts are attached to the window or not.
With this solution, we want to align mAddedItems and mGroups by removing the items in mAddedItems that are no longer in mGroups. This will stop mAddedItems uncontrolled growth and potentially fix the memory leak issue.
Bug: 378101061
Bug: 391677602
Test: Presubmit
Flag: android.widget.flags.drop_non_existing_messages
Change-Id: Ic9c1cb2f9cb01608941a4b16ff01a79d816c334d
4 files changed