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

Skip to content
Commit 2a769d8a authored by Kevin Chyn's avatar Kevin Chyn Committed by Android Build Coastguard Worker
Browse files

Do not use Map.Entry outside of lock

Map.Entry returned from Map#entrySet are tied to the backing map.
A change to the map is reflected to the Map.Entry. This causes
undefined behavior (including NPE) if we try to use them outside of
the lock. If a client removes their callback after we exit the lock
but before we invoke the client callbacks, we run into NPE. Instead,
lets copy the callback and executor into a separate data structure.

Fixes: 286512746
Test: atest DeviceStateControllerTests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ffb63d96f3a819ba86fbe543a203bf9124a18ad1)
Merged-In: I8ed29cf6e27f5c8020f120c3968896f627573a35
Change-Id: I8ed29cf6e27f5c8020f120c3968896f627573a35
parent 8e097216
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