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

Commit d684b41b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Handling Null profile references before connect"

parents 80a91cb5 8274a481
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -262,11 +262,15 @@ public class BluetoothControllerImpl implements BluetoothController {
            final int profile = profiles.keyAt(i);
            if (mProfiles.indexOfKey(profile) >= 0) {
                final Profile p = BluetoothUtil.getProfile(mProfiles.get(profile));
                if (p == null) {
                    Log.e(TAG, "Unable to get Profile for " + profileToString(profile));
                } else {
                    final boolean ok = connect ? p.connect(device) : p.disconnect(device);
                if (DEBUG) Log.d(TAG, action + " " + profileToString(profile) + " "
                        + (ok ? "succeeded" : "failed"));
                }
            } else {
                Log.w(TAG, "Unable get get Profile for " + profileToString(profile));
                Log.e(TAG, "Unable to get Profile for " + profileToString(profile));
            }
        }
    }