[Bugfix] Fix array out of bounds.

Problem:
JE caused by multi-threaded operation of WindowList.

Solution:
Lock to prevent array out of bounds.

Bug: 288065262
Test: Manual && Monkey Test
Change-Id: Idd58f5c74444e93758f89133779f2076f95f1725
This commit is contained in:
Luntao Wang
2023-06-20 21:05:13 +08:00
parent 00e1235fc8
commit 37fd8c29ff

View File

@@ -549,8 +549,8 @@ public class TaskPersister implements PersisterQueue.Listener {
// Write out one task.
byte[] data = null;
Task task = mTask;
if (DEBUG) Slog.d(TAG, "Writing task=" + task);
synchronized (mService.mGlobalLock) {
if (DEBUG) Slog.d(TAG, "Writing task=" + task);
if (task.inRecents) {
// Still there.
try {