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

Commit 930c982a authored by huwenbin1's avatar huwenbin1 Committed by Aurélien Pomini
Browse files

[WallpaperManagerService] java.lang.ArrayIndexOutOfBoundsException--Array index out of range: 0



[RootCause]:
1. attachServiceLocked() calls the forEachDisplayConnector() method to traverse the SparseArray, and then executes the connectLocked() method
2. Due to DeadObjectException, the connectLocked() method is executed and the detachWallpaperLocked() method is called according to the logic
3. Then wallpaper.connection.mDisplayConnector.clear() is executed;
4. After that, the size becomes 0, and forEachDisplayConnector reports ArrayIndexOutOfBoundsException when traversing the next element

Details: issue number:428643555

[Modify]:
Re-obtain size() before each access to ensure the index is valid

[Test]
UAT stability

Flag: EXEMPT trivial fix
Bug: 428643555
Test: presubmit

Change-Id: Id5751f9c64bf70f4f779dcb34a50d8a3b6f8eb9a
Signed-off-by: default avatarhuwenbin1 <huwenbin1@xiaomi.com>
parent 052d5fd9
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