/** * Start the bonding (pairing) process with the remote device. * * <p>This is an asynchronous call, it will return immediately. Register for {@link * #ACTION_BOND_STATE_CHANGED} intents to be notified when the bonding process completes, and its * result. * * <p>Android system services will handle the necessary user interactions to confirm and complete * the bonding process. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return false on immediate error, true if bonding will begin * @hide */ public boolean createBond() { try { return sService.createBond(mAddress); } catch (RemoteException e) { Log.e(TAG, "", e); } return false; }
/** * Start the bonding (pairing) process with the remote device. * * <p>This is an asynchronous call, it will return immediately. Register for {@link * #ACTION_BOND_STATE_CHANGED} intents to be notified when the bonding process completes, and its * result. * * <p>Android system services will handle the necessary user interactions to confirm and complete * the bonding process. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * * @return false on immediate error, true if bonding will begin * @hide */ public boolean createBond() { if (sService == null) { Log.e(TAG, "BT not enabled. Cannot create bond to Remote Device"); return false; } try { return sService.createBond(this); } catch (RemoteException e) { Log.e(TAG, "", e); } return false; }