Lines Matching refs:device

64     boolean connectInputDevice(BluetoothDevice device,
66 String objectPath = mBluetoothService.getObjectPathFromAddress(device.getAddress());
68 getInputDeviceConnectionState(device) != BluetoothInputDevice.STATE_DISCONNECTED ||
69 getInputDevicePriority(device) == BluetoothInputDevice.PRIORITY_OFF) {
82 boolean connectInputDeviceInternal(BluetoothDevice device) {
83 String objectPath = mBluetoothService.getObjectPathFromAddress(device.getAddress());
84 handleInputDeviceStateChange(device, BluetoothInputDevice.STATE_CONNECTING);
86 handleInputDeviceStateChange(device, BluetoothInputDevice.STATE_DISCONNECTED);
92 boolean disconnectInputDevice(BluetoothDevice device,
94 String objectPath = mBluetoothService.getObjectPathFromAddress(device.getAddress());
96 getInputDeviceConnectionState(device) == BluetoothInputDevice.STATE_DISCONNECTED) {
109 boolean disconnectInputDeviceInternal(BluetoothDevice device) {
110 String objectPath = mBluetoothService.getObjectPathFromAddress(device.getAddress());
111 handleInputDeviceStateChange(device, BluetoothInputDevice.STATE_DISCONNECTING);
113 handleInputDeviceStateChange(device, BluetoothInputDevice.STATE_CONNECTED);
119 int getInputDeviceConnectionState(BluetoothDevice device) {
120 if (mInputDevices.get(device) == null) {
123 return mInputDevices.get(device);
137 int getInputDevicePriority(BluetoothDevice device) {
139 Settings.Secure.getBluetoothInputDevicePriorityKey(device.getAddress()),
143 boolean setInputDevicePriority(BluetoothDevice device, int priority) {
144 if (!BluetoothAdapter.checkBluetoothAddress(device.getAddress())) {
148 Settings.Secure.getBluetoothInputDevicePriorityKey(device.getAddress()),
155 for (BluetoothDevice device: mInputDevices.keySet()) {
156 int inputDeviceState = getInputDeviceConnectionState(device);
159 inputDevices.add(device);
167 private void handleInputDeviceStateChange(BluetoothDevice device, int state) {
169 if (mInputDevices.get(device) == null) {
172 prevState = mInputDevices.get(device);
176 mInputDevices.put(device, state);
178 if (getInputDevicePriority(device) >
184 setInputDevicePriority(device, BluetoothInputDevice.PRIORITY_AUTO_CONNECT);
188 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
194 debugLog("InputDevice state : device: " + device + " State:" + prevState + "->" + state);
195 mBluetoothService.sendConnectionStateChange(device, BluetoothProfile.INPUT_DEVICE, state,
203 BluetoothDevice device = adapter.getRemoteDevice(address);
204 handleInputDeviceStateChange(device, state);
207 void setInitialInputDevicePriority(BluetoothDevice device, int state) {
210 if (getInputDevicePriority(device) == BluetoothInputDevice.PRIORITY_UNDEFINED) {
211 setInputDevicePriority(device, BluetoothInputDevice.PRIORITY_ON);
215 setInputDevicePriority(device, BluetoothInputDevice.PRIORITY_UNDEFINED);