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
Loading
Please register or sign in to comment