Loading core/java/android/bluetooth/BluetoothDeviceProfileState.java +1 −1 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine mA2dpService.getDevicesMatchingConnectionStates( new int[] {BluetoothA2dp.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTING}).length == 0) { BluetoothProfile.STATE_DISCONNECTING}).size() == 0) { mA2dpService.connect(mDevice); } if (mService.getInputDevicePriority(mDevice) == Loading core/java/android/bluetooth/BluetoothInputDevice.java +6 −10 Original line number Diff line number Diff line Loading @@ -24,10 +24,8 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.ArrayList; import java.util.List; /** * Public API for controlling the Bluetooth HID (Input Device) Profile Loading Loading @@ -167,18 +165,16 @@ public final class BluetoothInputDevice { /** Check if any Input Device is connected. * * @return a unmodifiable set of connected Input Devices, or null on error. * @return List of devices, empty List on error. * @hide */ public Set<BluetoothDevice> getConnectedInputDevices() { public List<BluetoothDevice> getConnectedInputDevices() { if (DBG) log("getConnectedInputDevices()"); try { return Collections.unmodifiableSet( new HashSet<BluetoothDevice>( Arrays.asList(mService.getConnectedInputDevices()))); return mService.getConnectedInputDevices(); } catch (RemoteException e) { Log.e(TAG, "", e); return null; return new ArrayList<BluetoothDevice>(); } } Loading core/java/android/bluetooth/BluetoothPan.java +8 −12 Original line number Diff line number Diff line Loading @@ -19,15 +19,13 @@ package android.bluetooth; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.content.Context; import android.os.ServiceManager; import android.os.RemoteException; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.ArrayList; import java.util.List; /** * @hide Loading Loading @@ -154,18 +152,16 @@ public final class BluetoothPan { * * Does not include devices that are currently connecting or disconnecting * * @return a unmodifiable set of connected PAN Devices, or null on error. * @return List of PAN devices or empty on Error * @hide */ public Set<BluetoothDevice> getConnectedDevices() { public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices"); try { return Collections.unmodifiableSet( new HashSet<BluetoothDevice>( Arrays.asList(mService.getConnectedPanDevices()))); return mService.getConnectedPanDevices(); } catch (RemoteException e) { Log.e(TAG, "", e); return null; return new ArrayList<BluetoothDevice>(); } } Loading core/java/android/bluetooth/IBluetooth.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ interface IBluetooth // HID profile APIs boolean connectInputDevice(in BluetoothDevice device); boolean disconnectInputDevice(in BluetoothDevice device); BluetoothDevice[] getConnectedInputDevices(); // change to Set<> once AIDL supports List<BluetoothDevice> getConnectedInputDevices(); int getInputDeviceState(in BluetoothDevice device); boolean setInputDevicePriority(in BluetoothDevice device, int priority); int getInputDevicePriority(in BluetoothDevice device); Loading @@ -89,7 +89,7 @@ interface IBluetooth boolean isTetheringOn(); void setBluetoothTethering(boolean value); int getPanDeviceState(in BluetoothDevice device); BluetoothDevice[] getConnectedPanDevices(); List<BluetoothDevice> getConnectedPanDevices(); boolean connectPanDevice(in BluetoothDevice device); boolean disconnectPanDevice(in BluetoothDevice device); } core/java/android/server/BluetoothEventLoop.java +5 −4 Original line number Diff line number Diff line Loading @@ -29,11 +29,12 @@ import android.content.Intent; import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.os.PowerManager; import android.util.Log; import java.util.HashMap; import java.util.List; import java.util.Set; import android.os.PowerManager; /** Loading Loading @@ -629,7 +630,7 @@ class BluetoothEventLoop { } private boolean isOtherInputDeviceConnected(String address) { Set<BluetoothDevice> devices = List<BluetoothDevice> devices = mBluetoothService.lookupInputDevicesMatchingStates(new int[] { BluetoothInputDevice.STATE_CONNECTING, BluetoothInputDevice.STATE_CONNECTED}); Loading @@ -654,7 +655,7 @@ class BluetoothEventLoop { } private boolean isOtherSinkInNonDisconnectedState(String address) { Set<BluetoothDevice> devices = List<BluetoothDevice> devices = mA2dp.getDevicesMatchingConnectionStates(new int[] {BluetoothA2dp.STATE_CONNECTED, BluetoothA2dp.STATE_CONNECTING, BluetoothA2dp.STATE_DISCONNECTING}); Loading Loading
core/java/android/bluetooth/BluetoothDeviceProfileState.java +1 −1 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine mA2dpService.getDevicesMatchingConnectionStates( new int[] {BluetoothA2dp.STATE_CONNECTED, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTING}).length == 0) { BluetoothProfile.STATE_DISCONNECTING}).size() == 0) { mA2dpService.connect(mDevice); } if (mService.getInputDevicePriority(mDevice) == Loading
core/java/android/bluetooth/BluetoothInputDevice.java +6 −10 Original line number Diff line number Diff line Loading @@ -24,10 +24,8 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.ArrayList; import java.util.List; /** * Public API for controlling the Bluetooth HID (Input Device) Profile Loading Loading @@ -167,18 +165,16 @@ public final class BluetoothInputDevice { /** Check if any Input Device is connected. * * @return a unmodifiable set of connected Input Devices, or null on error. * @return List of devices, empty List on error. * @hide */ public Set<BluetoothDevice> getConnectedInputDevices() { public List<BluetoothDevice> getConnectedInputDevices() { if (DBG) log("getConnectedInputDevices()"); try { return Collections.unmodifiableSet( new HashSet<BluetoothDevice>( Arrays.asList(mService.getConnectedInputDevices()))); return mService.getConnectedInputDevices(); } catch (RemoteException e) { Log.e(TAG, "", e); return null; return new ArrayList<BluetoothDevice>(); } } Loading
core/java/android/bluetooth/BluetoothPan.java +8 −12 Original line number Diff line number Diff line Loading @@ -19,15 +19,13 @@ package android.bluetooth; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.content.Context; import android.os.ServiceManager; import android.os.RemoteException; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.ArrayList; import java.util.List; /** * @hide Loading Loading @@ -154,18 +152,16 @@ public final class BluetoothPan { * * Does not include devices that are currently connecting or disconnecting * * @return a unmodifiable set of connected PAN Devices, or null on error. * @return List of PAN devices or empty on Error * @hide */ public Set<BluetoothDevice> getConnectedDevices() { public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices"); try { return Collections.unmodifiableSet( new HashSet<BluetoothDevice>( Arrays.asList(mService.getConnectedPanDevices()))); return mService.getConnectedPanDevices(); } catch (RemoteException e) { Log.e(TAG, "", e); return null; return new ArrayList<BluetoothDevice>(); } } Loading
core/java/android/bluetooth/IBluetooth.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ interface IBluetooth // HID profile APIs boolean connectInputDevice(in BluetoothDevice device); boolean disconnectInputDevice(in BluetoothDevice device); BluetoothDevice[] getConnectedInputDevices(); // change to Set<> once AIDL supports List<BluetoothDevice> getConnectedInputDevices(); int getInputDeviceState(in BluetoothDevice device); boolean setInputDevicePriority(in BluetoothDevice device, int priority); int getInputDevicePriority(in BluetoothDevice device); Loading @@ -89,7 +89,7 @@ interface IBluetooth boolean isTetheringOn(); void setBluetoothTethering(boolean value); int getPanDeviceState(in BluetoothDevice device); BluetoothDevice[] getConnectedPanDevices(); List<BluetoothDevice> getConnectedPanDevices(); boolean connectPanDevice(in BluetoothDevice device); boolean disconnectPanDevice(in BluetoothDevice device); }
core/java/android/server/BluetoothEventLoop.java +5 −4 Original line number Diff line number Diff line Loading @@ -29,11 +29,12 @@ import android.content.Intent; import android.os.Handler; import android.os.Message; import android.os.ParcelUuid; import android.os.PowerManager; import android.util.Log; import java.util.HashMap; import java.util.List; import java.util.Set; import android.os.PowerManager; /** Loading Loading @@ -629,7 +630,7 @@ class BluetoothEventLoop { } private boolean isOtherInputDeviceConnected(String address) { Set<BluetoothDevice> devices = List<BluetoothDevice> devices = mBluetoothService.lookupInputDevicesMatchingStates(new int[] { BluetoothInputDevice.STATE_CONNECTING, BluetoothInputDevice.STATE_CONNECTED}); Loading @@ -654,7 +655,7 @@ class BluetoothEventLoop { } private boolean isOtherSinkInNonDisconnectedState(String address) { Set<BluetoothDevice> devices = List<BluetoothDevice> devices = mA2dp.getDevicesMatchingConnectionStates(new int[] {BluetoothA2dp.STATE_CONNECTED, BluetoothA2dp.STATE_CONNECTING, BluetoothA2dp.STATE_DISCONNECTING}); Loading