Handle multithreading in ActiveGestureLog
ArrayList.add is not thread-safe. Attempting rapid calls across threads is the only way for it to throw ArrayIndexOutOfBoundsException. Flag: EXEMPT bug fix Fixes: 360619084 Test: checked TIS logs Change-Id: I66e5f2e13d5237717abcf42e56efa2942f317676
This commit is contained in:
@@ -23,6 +23,7 @@ import com.android.launcher3.util.Preconditions;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -237,7 +238,8 @@ public class ActiveGestureLog {
|
||||
/** An entire log of entries associated with a single log ID */
|
||||
protected static class EventLog {
|
||||
|
||||
protected final List<EventEntry> eventEntries = new ArrayList<>();
|
||||
protected final List<EventEntry> eventEntries =
|
||||
Collections.synchronizedList(new ArrayList<>());
|
||||
protected final int logId;
|
||||
protected final boolean mIsFullyGesturalNavMode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user