import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
+import android.bluetooth.BluetoothInputDevice;
+import android.bluetooth.BluetoothPan;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
mManager.getCachedDeviceManager().onProfileStateChanged(device,
Profile.A2DP, newState);
+ } else if (action.equals(BluetoothInputDevice.ACTION_INPUT_DEVICE_STATE_CHANGED)) {
+ final int newState = intent.getIntExtra(
+ BluetoothInputDevice.EXTRA_INPUT_DEVICE_STATE, 0);
+ final int oldState = intent.getIntExtra(
+ BluetoothInputDevice.EXTRA_PREVIOUS_INPUT_DEVICE_STATE, 0);
+ if (newState == BluetoothInputDevice.STATE_DISCONNECTED &&
+ oldState == BluetoothInputDevice.STATE_CONNECTING) {
+ Log.i(TAG, "Failed to connect BT HID");
+ }
+
+ mManager.getCachedDeviceManager().onProfileStateChanged(device,
+ Profile.HID, newState);
+
+ } else if (action.equals(BluetoothPan.ACTION_PAN_STATE_CHANGED)) {
+ final int newState = intent.getIntExtra(
+ BluetoothPan.EXTRA_PAN_STATE, 0);
+ final int oldState = intent.getIntExtra(
+ BluetoothPan.EXTRA_PREVIOUS_PAN_STATE, 0);
+ if (newState == BluetoothPan.STATE_DISCONNECTED &&
+ oldState == BluetoothPan.STATE_CONNECTING) {
+ Log.i(TAG, "Failed to connect BT PAN");
+ }
+ mManager.getCachedDeviceManager().onProfileStateChanged(device,
+ Profile.PAN, newState);
+
} else if (action.equals(BluetoothDevice.ACTION_CLASS_CHANGED)) {
mManager.getCachedDeviceManager().onBtClassChanged(device);
// Fine-grained state broadcasts
filter.addAction(BluetoothA2dp.ACTION_SINK_STATE_CHANGED);
filter.addAction(BluetoothHeadset.ACTION_STATE_CHANGED);
+ filter.addAction(BluetoothPan.ACTION_PAN_STATE_CHANGED);
filter.addAction(BluetoothDevice.ACTION_CLASS_CHANGED);
filter.addAction(BluetoothDevice.ACTION_UUID);