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

Commit 3ac7440e authored by Lars Demmler's avatar Lars Demmler Committed by Cherrypicker Worker
Browse files

Fix ArrayIndexOfBoundsException in WallpaperManagerService

Bug: 418799201

The mDisplayConnector array is used and modified from multiple
threads. The modifications of this array, e.g. in
detachWallpaperLocked, are locked properly, but this doesn't hold
for all methods that loop through its items! This can result in an
ArrayIndexOfBoundsException in these methods if an array
modification happens asynchronously while executing such a loop. An
asynchronous loop through all array items is invoked for example
via "FgThread.getHandler().post()" in
WallpaperManagerService.switchUser.

Thus, this change adds a synchronization lock to all methods that
loop through the mDisplayConnector items.
(cherry picked from https://android-review.googlesource.com/q/commit:d03f3fdcbcc9b5a6f5465819db843d918f9bb76f)
Merged-In: I6593d35b5049e14fba1ccbf2f582ac93602bb9fe
Change-Id: I6593d35b5049e14fba1ccbf2f582ac93602bb9fe
parent ce48679b
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