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

Commit d5e99a96 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix connecting to profiles when bonding from local device (1/3)

When bond is created from Bluetooth Settings, profiles gets properly
auto connected when services are discovered. If pairing is done from any
other app, i.e. NFC app, the bond is not being recognized as initiated
from local device, and profiles are not connected.

This patch makes sure that if bonding is initiated, no matter from which
app, it will cause proper profiles to connect.

Bug: 30211618
Change-Id: I71131f33eb5b9db2f5b4a8737b191d541bf1fd3d
parent 5e3d34a0
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -892,6 +892,14 @@ public final class BluetoothDevice implements Parcelable {
        return false;
        return false;
    }
    }


    /** @hide */
    public boolean isBondingInitiatedLocally() {
        try {
            return sService.isBondingInitiatedLocally(this);
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
    }

    /**
    /**
     * Set the Out Of Band data for a remote device to be used later
     * Set the Out Of Band data for a remote device to be used later
     * in the pairing mechanism. Users can obtain this data through other
     * in the pairing mechanism. Users can obtain this data through other
+1 −0
Original line number Original line Diff line number Diff line
@@ -62,6 +62,7 @@ interface IBluetooth
    boolean cancelBondProcess(in BluetoothDevice device);
    boolean cancelBondProcess(in BluetoothDevice device);
    boolean removeBond(in BluetoothDevice device);
    boolean removeBond(in BluetoothDevice device);
    int getBondState(in BluetoothDevice device);
    int getBondState(in BluetoothDevice device);
    boolean isBondingInitiatedLocally(in BluetoothDevice device);
    int getConnectionState(in BluetoothDevice device);
    int getConnectionState(in BluetoothDevice device);


    String getRemoteName(in BluetoothDevice device);
    String getRemoteName(in BluetoothDevice device);