summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2021-12-10 16:21:36 -0800
committerHui Yu <huiyu@google.com>2022-01-05 10:59:02 -0800
commit703cf10c59cf5d98cefe3347e905a492b092f27a (patch)
tree53001fa1f56bee0225844260531b643815c5833a /core/java/android/inputmethodservice/InputMethodService.java
parentda94cf36583d99d463fb17f7fc04d324c015f6f9 (diff)
Synchronize on the SparseArray object in PendingTempAllowlists.
The field mPendingTempAllowlist in PendingTempAllowlists is a SparseArray. In ActivityManagerService, the lock protection for PendingTempAllowlists object is: @CompositeRWLock({"this", "mProcLock"}) final PendingTempAllowlists mPendingTempAllowlist Which means the mPendingTempAllowlist object can be read when either "this" lock or "mProcLock" lock is held. But the read-operation of SparseArray such as indexOfKey() and size() etc, actually mutate the SparseArray by calling SparseArray.gc(). This makes @CompositeRWLock not to be compatible with SparseArray. Since we can not make SparseArray thread-safe, also we want to maintain the semantic of @CompositeRWLock, we can make PendingTempAllowlists thread-safe at least. Bug: 193788840 Test: Regression test. Change-Id: Ie1c239ad27d1fd6b76676951b470605513848b20
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions