Files
frameworks_base/core/java/android/util
Kweku Adams f6ea6733b0 Address static cache access issues.
ArrayMap and ArraySet are not thread safe, so callers are expected to
lock around their instances before calling any methods. However, if a
caller fails to lock, there can be races that end up corrupting the
cache pool (despite having the class level lock held). A corrupted pool
causes issues for other ArrayMap/Set instances, even if those instances
are properly used under locks. There's no way to guard against cache
pool corruption without making ArrayMap/Set fully thread-safe, changing
the pool structure, or appropriately locking around each ArrayMap/Set
instance.

For now, we make ArraySet throw ConcurrentModificationException on a best
effort basis to provide better awareness when an ArraySet is accessed
concurrently without any locks and try to detect when the cache is
corrupted.

Bug: 62282384
Bug: 73549921
Bug: 122969275
Bug: 139015193
Bug: 139401479
Test: atest CtsUtilTestCases:ArrayMapTest
Test: atest CtsUtilTestCases:ArraySetTest
Test: atest FrameworksCoreTests:ArrayMapTest
Test: atest FrameworksCoreTests:ArraySetTest
Change-Id: Icd76630b25afd9f3627239301ffa5c37da25ea18
2019-08-20 19:13:15 -07:00
..
2019-06-11 07:30:31 -07:00
2018-12-17 10:25:25 +00:00
2018-08-14 17:32:44 +01:00
2019-03-14 16:26:05 -07:00