Loading android/app/src/com/android/bluetooth/pan/PanService.java +17 −6 Original line number Diff line number Diff line Loading @@ -137,10 +137,18 @@ public class PanService extends ProfileService { mNativeAvailable = false; } if (mPanDevices != null) { List<BluetoothDevice> devList = getConnectedDevices(); for (BluetoothDevice dev : devList) { handlePanDeviceStateChange(dev, mPanIfName, BluetoothProfile.STATE_DISCONNECTED, BluetoothPan.LOCAL_PANU_ROLE, BluetoothPan.REMOTE_NAP_ROLE); int[] desiredStates = {BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTING}; List<BluetoothDevice> devList = getDevicesMatchingConnectionStates(desiredStates); for (BluetoothDevice device : devList) { BluetoothPanDevice panDevice = mPanDevices.get(device); Log.d(TAG, "panDevice: " + panDevice + " device address: " + device); if (panDevice != null) { handlePanDeviceStateChange(device, mPanIfName, BluetoothProfile.STATE_DISCONNECTED, panDevice.mLocalRole, panDevice.mRemoteRole); } } mPanDevices.clear(); } Loading Loading @@ -497,12 +505,13 @@ public class PanService extends ProfileService { if (panDevice == null) { Log.i(TAG, "state " + state + " Num of connected pan devices: " + mPanDevices.size()); prevState = BluetoothProfile.STATE_DISCONNECTED; panDevice = new BluetoothPanDevice(state, iface, localRole); panDevice = new BluetoothPanDevice(state, iface, localRole, remoteRole); mPanDevices.put(device, panDevice); } else { prevState = panDevice.mState; panDevice.mState = state; panDevice.mLocalRole = localRole; panDevice.mRemoteRole = remoteRole; panDevice.mIface = iface; } Loading Loading @@ -689,11 +698,13 @@ public class PanService extends ProfileService { private int mState; private String mIface; private int mLocalRole; // Which local role is this PAN device bound to private int mRemoteRole; // Which remote role is this PAN device bound to BluetoothPanDevice(int state, String iface, int localRole) { BluetoothPanDevice(int state, String iface, int localRole, int remoteRole) { mState = state; mIface = iface; mLocalRole = localRole; mRemoteRole = remoteRole; } } Loading Loading
android/app/src/com/android/bluetooth/pan/PanService.java +17 −6 Original line number Diff line number Diff line Loading @@ -137,10 +137,18 @@ public class PanService extends ProfileService { mNativeAvailable = false; } if (mPanDevices != null) { List<BluetoothDevice> devList = getConnectedDevices(); for (BluetoothDevice dev : devList) { handlePanDeviceStateChange(dev, mPanIfName, BluetoothProfile.STATE_DISCONNECTED, BluetoothPan.LOCAL_PANU_ROLE, BluetoothPan.REMOTE_NAP_ROLE); int[] desiredStates = {BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.STATE_DISCONNECTING}; List<BluetoothDevice> devList = getDevicesMatchingConnectionStates(desiredStates); for (BluetoothDevice device : devList) { BluetoothPanDevice panDevice = mPanDevices.get(device); Log.d(TAG, "panDevice: " + panDevice + " device address: " + device); if (panDevice != null) { handlePanDeviceStateChange(device, mPanIfName, BluetoothProfile.STATE_DISCONNECTED, panDevice.mLocalRole, panDevice.mRemoteRole); } } mPanDevices.clear(); } Loading Loading @@ -497,12 +505,13 @@ public class PanService extends ProfileService { if (panDevice == null) { Log.i(TAG, "state " + state + " Num of connected pan devices: " + mPanDevices.size()); prevState = BluetoothProfile.STATE_DISCONNECTED; panDevice = new BluetoothPanDevice(state, iface, localRole); panDevice = new BluetoothPanDevice(state, iface, localRole, remoteRole); mPanDevices.put(device, panDevice); } else { prevState = panDevice.mState; panDevice.mState = state; panDevice.mLocalRole = localRole; panDevice.mRemoteRole = remoteRole; panDevice.mIface = iface; } Loading Loading @@ -689,11 +698,13 @@ public class PanService extends ProfileService { private int mState; private String mIface; private int mLocalRole; // Which local role is this PAN device bound to private int mRemoteRole; // Which remote role is this PAN device bound to BluetoothPanDevice(int state, String iface, int localRole) { BluetoothPanDevice(int state, String iface, int localRole, int remoteRole) { mState = state; mIface = iface; mLocalRole = localRole; mRemoteRole = remoteRole; } } Loading