Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d34a7cf3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add null check when receiving PAN connection state changed" am: 7f159433

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1392877

Change-Id: Ie2a29899b2e8924b230401dbc5620aa9540cb0c7
parents 002a253f 7f159433
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -206,12 +206,17 @@ public class PanService extends ProfileService {
                break;
                break;
                case MESSAGE_CONNECT_STATE_CHANGED: {
                case MESSAGE_CONNECT_STATE_CHANGED: {
                    ConnectState cs = (ConnectState) msg.obj;
                    ConnectState cs = (ConnectState) msg.obj;
                    BluetoothDevice device = getDevice(cs.addr);
                    final BluetoothDevice device = getDevice(cs.addr);
                    // TBD get iface from the msg
                    // TBD get iface from the msg
                    if (DBG) {
                    if (DBG) {
                        Log.d(TAG,
                        Log.d(TAG,
                                "MESSAGE_CONNECT_STATE_CHANGED: " + device + " state: " + cs.state);
                                "MESSAGE_CONNECT_STATE_CHANGED: " + device + " state: " + cs.state);
                    }
                    }
                    // It could be null if the connection up is coming when the Bluetooth is turning
                    // off.
                    if (device == null) {
                        break;
                    }
                    handlePanDeviceStateChange(device, mPanIfName /* iface */,
                    handlePanDeviceStateChange(device, mPanIfName /* iface */,
                            convertHalState(cs.state), cs.local_role, cs.remote_role);
                            convertHalState(cs.state), cs.local_role, cs.remote_role);
                }
                }