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

Commit db74f3db authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

Check nullness for disconnecting bluetooth device

There was a potential crash that unknown bt device is disconnected.

Bug: 147654651
Test: manually
Change-Id: If5e3d63a27f1c82ac3238a52188a597f48bd2ae1
parent 6fd5b06f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -306,11 +306,13 @@ class BluetoothRouteProvider {
                }
            } else if (state == BluetoothProfile.STATE_DISCONNECTING
                    || state == BluetoothProfile.STATE_DISCONNECTED) {
                if (btRoute != null) {
                    btRoute.connectedProfiles.delete(profile);
                    if (btRoute.connectedProfiles.size() == 0) {
                        mBluetoothRoutes.remove(device.getAddress());
                        if (mActiveDevice != null
                            && TextUtils.equals(mActiveDevice.getAddress(), device.getAddress())) {
                                && TextUtils.equals(mActiveDevice.getAddress(),
                                device.getAddress())) {
                            mActiveDevice = null;
                        }
                        notifyBluetoothRoutesUpdated();
@@ -319,3 +321,4 @@ class BluetoothRouteProvider {
            }
        }
    }
}