Loading src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +12 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,9 @@ import com.android.server.telecom.BluetoothAdapterProxy; import com.android.server.telecom.BluetoothHeadsetProxy; import com.android.server.telecom.TelecomSystem; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; Loading Loading @@ -103,11 +105,16 @@ public class BluetoothDeviceManager { } public int getNumConnectedDevices() { synchronized (mLock) { return mConnectedDevicesByAddress.size(); } } public Collection<BluetoothDevice> getConnectedDevices() { return mConnectedDevicesByAddress.values(); synchronized (mLock) { return Collections.unmodifiableCollection( new ArrayList<>(mConnectedDevicesByAddress.values())); } } public String getMostRecentlyConnectedDevice(String excludeAddress) { Loading @@ -131,8 +138,10 @@ public class BluetoothDeviceManager { } public BluetoothDevice getDeviceFromAddress(String address) { synchronized (mLock) { return mConnectedDevicesByAddress.get(address); } } void onDeviceConnected(BluetoothDevice device) { synchronized (mLock) { Loading src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +1 −4 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ import com.android.server.telecom.BluetoothHeadsetProxy; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.Timeouts; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; Loading Loading @@ -572,8 +570,7 @@ public class BluetoothRouteManager extends StateMachine { } public Collection<BluetoothDevice> getConnectedDevices() { return Collections.unmodifiableCollection( new ArrayList<>(mDeviceManager.getConnectedDevices())); return mDeviceManager.getConnectedDevices(); } private String connectHfpAudio(String address) { Loading Loading
src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +12 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,9 @@ import com.android.server.telecom.BluetoothAdapterProxy; import com.android.server.telecom.BluetoothHeadsetProxy; import com.android.server.telecom.TelecomSystem; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; Loading Loading @@ -103,11 +105,16 @@ public class BluetoothDeviceManager { } public int getNumConnectedDevices() { synchronized (mLock) { return mConnectedDevicesByAddress.size(); } } public Collection<BluetoothDevice> getConnectedDevices() { return mConnectedDevicesByAddress.values(); synchronized (mLock) { return Collections.unmodifiableCollection( new ArrayList<>(mConnectedDevicesByAddress.values())); } } public String getMostRecentlyConnectedDevice(String excludeAddress) { Loading @@ -131,8 +138,10 @@ public class BluetoothDeviceManager { } public BluetoothDevice getDeviceFromAddress(String address) { synchronized (mLock) { return mConnectedDevicesByAddress.get(address); } } void onDeviceConnected(BluetoothDevice device) { synchronized (mLock) { Loading
src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +1 −4 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ import com.android.server.telecom.BluetoothHeadsetProxy; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.Timeouts; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; Loading Loading @@ -572,8 +570,7 @@ public class BluetoothRouteManager extends StateMachine { } public Collection<BluetoothDevice> getConnectedDevices() { return Collections.unmodifiableCollection( new ArrayList<>(mDeviceManager.getConnectedDevices())); return mDeviceManager.getConnectedDevices(); } private String connectHfpAudio(String address) { Loading