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

Commit e476fcdd authored by Srinu Jella's avatar Srinu Jella Committed by Nitin Shivpure
Browse files

Bluetooth: Make Bonded device list operations are synchronous

Change the bonded device list to CopyOnWriteArrayList,to take
care of concurrent add/delete operations to the bonded device
list.

Change-Id: Ia4de2d35f2e30d6407716d0e60dc3bf4d05a2ac5
parent 0156079a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.bluetooth.btservice.RemoteDevices.DeviceProperties;

import java.util.HashMap;
import java.util.ArrayList;
import java.util.concurrent.CopyOnWriteArrayList;

class AdapterProperties {
    private static final boolean DBG = true;
@@ -44,7 +45,7 @@ class AdapterProperties {
    private int mScanMode;
    private int mDiscoverableTimeout;
    private ParcelUuid[] mUuids;
    private ArrayList<BluetoothDevice> mBondedDevices = new ArrayList<BluetoothDevice>();
    private CopyOnWriteArrayList<BluetoothDevice> mBondedDevices = new CopyOnWriteArrayList<BluetoothDevice>();

    private int mProfilesConnecting, mProfilesConnected, mProfilesDisconnecting;
    private HashMap<Integer, Pair<Integer, Integer>> mProfileConnectionState;