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

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

Merge "PBAP: Disconnect PBAP profile only if connected"

parents 4ce5b479 5f18b7c0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -88,8 +88,13 @@ public final class PbapServerProfile implements LocalBluetoothProfile {
    }

    public boolean disconnect(BluetoothDevice device) {
        if (mService == null) return false;
        if (mService == null || device == null) return false;

        if (getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED)
            return mService.disconnect();

        Log.d(TAG, "pbap server not connected to "  + device.getAddress());
        return false;
    }

    public int getConnectionStatus(BluetoothDevice device) {