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

Commit ddef9a0d authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Android (Google) Code Review
Browse files

Merge "Make CommandQueue callbacks thread safe" into main

parents 6b5333d4 2569de9f
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -85,8 +85,9 @@ import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;


/**
/**
 * This class takes the functions from IStatusBar that come in on
 * This class takes the functions from IStatusBar that come in on
@@ -198,7 +199,7 @@ public class CommandQueue extends IStatusBar.Stub implements
    private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";
    private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";


    private final Object mLock = new Object();
    private final Object mLock = new Object();
    private final ArrayList<Callbacks> mCallbacks = new ArrayList<>();
    private final List<Callbacks> mCallbacks = new CopyOnWriteArrayList<Callbacks>();
    private final Handler mHandler = new H(Looper.getMainLooper());
    private final Handler mHandler = new H(Looper.getMainLooper());
    /** A map of display id - disable flag pair */
    /** A map of display id - disable flag pair */
    private final SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();
    private final SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();