Loading core/java/android/bluetooth/BluetoothDevice.java +20 −0 Original line number Diff line number Diff line Loading @@ -873,6 +873,26 @@ public final class BluetoothDevice implements Parcelable { return BOND_NONE; } /** * Returns whether there is an open connection to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one open connection to this device. * @hide */ public boolean isConnected() { if (sService == null) { // BT is not enabled, we cannot be connected. return false; } try { return sService.isConnected(this); } catch (RemoteException e) { Log.e(TAG, "", e); return false; } } /** * Get the Bluetooth class of the remote device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. Loading core/java/android/bluetooth/IBluetooth.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ interface IBluetooth boolean cancelBondProcess(in BluetoothDevice device); boolean removeBond(in BluetoothDevice device); int getBondState(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); String getRemoteName(in BluetoothDevice device); int getRemoteType(in BluetoothDevice device); Loading Loading
core/java/android/bluetooth/BluetoothDevice.java +20 −0 Original line number Diff line number Diff line Loading @@ -873,6 +873,26 @@ public final class BluetoothDevice implements Parcelable { return BOND_NONE; } /** * Returns whether there is an open connection to this device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. * * @return True if there is at least one open connection to this device. * @hide */ public boolean isConnected() { if (sService == null) { // BT is not enabled, we cannot be connected. return false; } try { return sService.isConnected(this); } catch (RemoteException e) { Log.e(TAG, "", e); return false; } } /** * Get the Bluetooth class of the remote device. * <p>Requires {@link android.Manifest.permission#BLUETOOTH}. Loading
core/java/android/bluetooth/IBluetooth.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ interface IBluetooth boolean cancelBondProcess(in BluetoothDevice device); boolean removeBond(in BluetoothDevice device); int getBondState(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); String getRemoteName(in BluetoothDevice device); int getRemoteType(in BluetoothDevice device); Loading