/**@class android.bluetooth.BluetoothDevice implements android.os.Parcelable @extends java.lang.Object Represents a remote Bluetooth device. A {@link android.bluetooth.BluetoothDevice} lets you create a connection with the respective device or query information about it, such as the name, address, class, and bonding state. <p>This class is really just a thin wrapper for a Bluetooth hardware address. Objects of this class are immutable. Operations on this class are performed on the remote Bluetooth hardware address, using the {@link android.bluetooth.BluetoothAdapter} that was used to create this {@link android.bluetooth.BluetoothDevice}. <p>To get a {@link android.bluetooth.BluetoothDevice}, use {@link android.bluetooth.BluetoothAdapter#getRemoteDevice(String) android.bluetooth.BluetoothAdapter.getRemoteDevice(String)} to create one representing a device of a known MAC address (which you can get through device discovery with {@link android.bluetooth.BluetoothAdapter}) or get one from the set of bonded devices returned by {@link android.bluetooth.BluetoothAdapter#getBondedDevices() android.bluetooth.BluetoothAdapter.getBondedDevices()}. You can then open a {@link android.bluetooth.BluetoothSocket} for communication with the remote device, using {@link #createRfcommSocketToServiceRecord}(UUID) over Bluetooth BR/EDR or using {@link #createL2capChannel(int)} over Bluetooth LE. <p class="note"><strong>Note:</strong> Requires the {@link android.Manifest.permission#BLUETOOTH} permission. <div class="special reference"> <h3>Developer Guides</h3> <p> For more information about using Bluetooth, read the <a href= "{@docRoot}guide/topics/connectivity/bluetooth.html">Bluetooth</a> developer guide. </p> </div> {@see BluetoothAdapter} {@see BluetoothSocket} */ var BluetoothDevice = { /** Sentinel error value for this class. Guaranteed to not equal any other integer constant in this class. Provided as a convenience for functions that require a sentinel error value, for example: <p><code>Intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR)</code> */ ERROR : "-2147483648", /** Broadcast Action: Remote device discovered. <p>Sent when a remote device is found during discovery. <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_CLASS}. Can contain the extra fields {@link #EXTRA_NAME} and/or {@link #EXTRA_RSSI} if they are available. <p>Requires {@link android.Manifest.permission#BLUETOOTH} and {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} to receive. */ ACTION_FOUND : "android.bluetooth.device.action.FOUND", /** Broadcast Action: Bluetooth class of a remote device has changed. <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_CLASS}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. {@see BluetoothClass} */ ACTION_CLASS_CHANGED : "android.bluetooth.device.action.CLASS_CHANGED", /** Broadcast Action: Indicates a low level (ACL) connection has been established with a remote device. <p>Always contains the extra field {@link #EXTRA_DEVICE}. <p>ACL connections are managed automatically by the Android Bluetooth stack. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. */ ACTION_ACL_CONNECTED : "android.bluetooth.device.action.ACL_CONNECTED", /** Broadcast Action: Indicates that a low level (ACL) disconnection has been requested for a remote device, and it will soon be disconnected. <p>This is useful for graceful disconnection. Applications should use this intent as a hint to immediately terminate higher level connections (RFCOMM, L2CAP, or profile connections) to the remote device. <p>Always contains the extra field {@link #EXTRA_DEVICE}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. */ ACTION_ACL_DISCONNECT_REQUESTED : "android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED", /** Broadcast Action: Indicates a low level (ACL) disconnection from a remote device. <p>Always contains the extra field {@link #EXTRA_DEVICE}. <p>ACL connections are managed automatically by the Android Bluetooth stack. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. */ ACTION_ACL_DISCONNECTED : "android.bluetooth.device.action.ACL_DISCONNECTED", /** Broadcast Action: Indicates the friendly name of a remote device has been retrieved for the first time, or changed since the last retrieval. <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_NAME}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. */ ACTION_NAME_CHANGED : "android.bluetooth.device.action.NAME_CHANGED", /** Broadcast Action: Indicates the alias of a remote device has been changed. <p>Always contains the extra field {@link #EXTRA_DEVICE}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. @hide */ ACTION_ALIAS_CHANGED : "android.bluetooth.device.action.ALIAS_CHANGED", /** Broadcast Action: Indicates a change in the bond state of a remote device. For example, if a device is bonded (paired). <p>Always contains the extra fields {@link #EXTRA_DEVICE}, {@link #EXTRA_BOND_STATE} and {@link #EXTRA_PREVIOUS_BOND_STATE}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. */ ACTION_BOND_STATE_CHANGED : "android.bluetooth.device.action.BOND_STATE_CHANGED", /** Broadcast Action: Indicates the battery level of a remote device has been retrieved for the first time, or changed since the last retrieval <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link #EXTRA_BATTERY_LEVEL}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. @hide */ ACTION_BATTERY_LEVEL_CHANGED : "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED", /** Used as an Integer extra field in {@link #ACTION_BATTERY_LEVEL_CHANGED} intent. It contains the most recently retrieved battery level information ranging from 0% to 100% for a remote device, {@link #BATTERY_LEVEL_UNKNOWN} when the valid is unknown or there is an error @hide */ EXTRA_BATTERY_LEVEL : "android.bluetooth.device.extra.BATTERY_LEVEL", /** Used as the unknown value for {@link #EXTRA_BATTERY_LEVEL} and {@link #getBatteryLevel}() @hide */ BATTERY_LEVEL_UNKNOWN : "-1", /** Used as a Parcelable {@link android.bluetooth.BluetoothDevice} extra field in every intent broadcast by this class. It contains the {@link android.bluetooth.BluetoothDevice} that the intent applies to. */ EXTRA_DEVICE : "android.bluetooth.device.extra.DEVICE", /** Used as a String extra field in {@link #ACTION_NAME_CHANGED} and {@link #ACTION_FOUND} intents. It contains the friendly Bluetooth name. */ EXTRA_NAME : "android.bluetooth.device.extra.NAME", /** Used as an optional short extra field in {@link #ACTION_FOUND} intents. Contains the RSSI value of the remote device as reported by the Bluetooth hardware. */ EXTRA_RSSI : "android.bluetooth.device.extra.RSSI", /** Used as a Parcelable {@link android.bluetooth.BluetoothClass} extra field in {@link #ACTION_FOUND} and {@link #ACTION_CLASS_CHANGED} intents. */ EXTRA_CLASS : "android.bluetooth.device.extra.CLASS", /** Used as an int extra field in {@link #ACTION_BOND_STATE_CHANGED} intents. Contains the bond state of the remote device. <p>Possible values are: {@link #BOND_NONE}, {@link #BOND_BONDING}, {@link #BOND_BONDED}. */ EXTRA_BOND_STATE : "android.bluetooth.device.extra.BOND_STATE", /** Used as an int extra field in {@link #ACTION_BOND_STATE_CHANGED} intents. Contains the previous bond state of the remote device. <p>Possible values are: {@link #BOND_NONE}, {@link #BOND_BONDING}, {@link #BOND_BONDED}. */ EXTRA_PREVIOUS_BOND_STATE : "android.bluetooth.device.extra.PREVIOUS_BOND_STATE", /** Indicates the remote device is not bonded (paired). <p>There is no shared link key with the remote device, so communication (if it is allowed at all) will be unauthenticated and unencrypted. */ BOND_NONE : "10", /** Indicates bonding (pairing) is in progress with the remote device. */ BOND_BONDING : "11", /** Indicates the remote device is bonded (paired). <p>A shared link keys exists locally for the remote device, so communication can be authenticated and encrypted. <p><i>Being bonded (paired) with a remote device does not necessarily mean the device is currently connected. It just means that the pending procedure was completed at some earlier time, and the link key is still stored locally, ready to use on the next connection. </i> */ BOND_BONDED : "12", /** Used as an int extra field in {@link #ACTION_PAIRING_REQUEST} intents for unbond reason. @hide */ EXTRA_REASON : "android.bluetooth.device.extra.REASON", /** Used as an int extra field in {@link #ACTION_PAIRING_REQUEST} intents to indicate pairing method used. Possible values are: {@link #PAIRING_VARIANT_PIN}, {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION}, */ EXTRA_PAIRING_VARIANT : "android.bluetooth.device.extra.PAIRING_VARIANT", /** Used as an int extra field in {@link #ACTION_PAIRING_REQUEST} intents as the value of passkey. */ EXTRA_PAIRING_KEY : "android.bluetooth.device.extra.PAIRING_KEY", /** Bluetooth device type, Unknown */ DEVICE_TYPE_UNKNOWN : "0", /** Bluetooth device type, Classic - BR/EDR devices */ DEVICE_TYPE_CLASSIC : "1", /** Bluetooth device type, Low Energy - LE-only */ DEVICE_TYPE_LE : "2", /** Bluetooth device type, Dual Mode - BR/EDR/LE */ DEVICE_TYPE_DUAL : "3", /**@hide */ ACTION_SDP_RECORD : "android.bluetooth.device.action.SDP_RECORD", /** Maximum length of a metadata entry, this is to avoid exploding Bluetooth disk usage @hide */ METADATA_MAX_LENGTH : "2048", /** Manufacturer name of this Bluetooth device Data type should be {@String} as {@link Byte} array. @hide */ METADATA_MANUFACTURER_NAME : "0", /** Model name of this Bluetooth device Data type should be {@String} as {@link Byte} array. @hide */ METADATA_MODEL_NAME : "1", /** Software version of this Bluetooth device Data type should be {@String} as {@link Byte} array. @hide */ METADATA_SOFTWARE_VERSION : "2", /** Hardware version of this Bluetooth device Data type should be {@String} as {@link Byte} array. @hide */ METADATA_HARDWARE_VERSION : "3", /** Package name of the companion app, if any Data type should be {@String} as {@link Byte} array. @hide */ METADATA_COMPANION_APP : "4", /** URI to the main icon shown on the settings UI Data type should be {@link Byte} array. @hide */ METADATA_MAIN_ICON : "5", /** Whether this device is an untethered headset with left, right and case Data type should be {@String} as {@link Byte} array. @hide */ METADATA_IS_UNTETHERED_HEADSET : "6", /** URI to icon of the left headset Data type should be {@link Byte} array. @hide */ METADATA_UNTETHERED_LEFT_ICON : "7", /** URI to icon of the right headset Data type should be {@link Byte} array. @hide */ METADATA_UNTETHERED_RIGHT_ICON : "8", /** URI to icon of the headset charging case Data type should be {@link Byte} array. @hide */ METADATA_UNTETHERED_CASE_ICON : "9", /** Battery level of left headset Data type should be {@String} 0-100 as {@link Byte} array, otherwise as invalid. @hide */ METADATA_UNTETHERED_LEFT_BATTERY : "10", /** Battery level of rigth headset Data type should be {@String} 0-100 as {@link Byte} array, otherwise as invalid. @hide */ METADATA_UNTETHERED_RIGHT_BATTERY : "11", /** Battery level of the headset charging case Data type should be {@String} 0-100 as {@link Byte} array, otherwise as invalid. @hide */ METADATA_UNTETHERED_CASE_BATTERY : "12", /** Whether the left headset is charging Data type should be {@String} as {@link Byte} array. @hide */ METADATA_UNTETHERED_LEFT_CHARGING : "13", /** Whether the right headset is charging Data type should be {@String} as {@link Byte} array. @hide */ METADATA_UNTETHERED_RIGHT_CHARGING : "14", /** Whether the headset charging case is charging Data type should be {@String} as {@link Byte} array. @hide */ METADATA_UNTETHERED_CASE_CHARGING : "15", /** URI to the enhanced settings UI slice Data type should be {@String} as {@link Byte} array, null means the UI does not exist. @hide */ METADATA_ENHANCED_SETTINGS_UI_URI : "16", /** Broadcast Action: This intent is used to broadcast the {@link UUID} wrapped as a {@link android.os.ParcelUuid} of the remote device after it has been fetched. This intent is sent only when the UUIDs of the remote device are requested to be fetched using Service Discovery Protocol <p> Always contains the extra field {@link #EXTRA_DEVICE} <p> Always contains the extra field {@link #EXTRA_UUID} <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} to receive. */ ACTION_UUID : "android.bluetooth.device.action.UUID", /**@hide */ ACTION_MAS_INSTANCE : "android.bluetooth.device.action.MAS_INSTANCE", /** Broadcast Action: Indicates a failure to retrieve the name of a remote device. <p>Always contains the extra field {@link #EXTRA_DEVICE}. <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. @hide */ ACTION_NAME_FAILED : "android.bluetooth.device.action.NAME_FAILED", /** Broadcast Action: This intent is used to broadcast PAIRING REQUEST <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} to receive. */ ACTION_PAIRING_REQUEST : "android.bluetooth.device.action.PAIRING_REQUEST", /**@hide */ ACTION_PAIRING_CANCEL : "android.bluetooth.device.action.PAIRING_CANCEL", /**@hide */ ACTION_CONNECTION_ACCESS_REQUEST : "android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST", /**@hide */ ACTION_CONNECTION_ACCESS_REPLY : "android.bluetooth.device.action.CONNECTION_ACCESS_REPLY", /**@hide */ ACTION_CONNECTION_ACCESS_CANCEL : "android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL", /** Intent to broadcast silence mode changed. Alway contains the extra field {@link #EXTRA_DEVICE} @hide */ ACTION_SILENCE_MODE_CHANGED : "android.bluetooth.device.action.SILENCE_MODE_CHANGED", /** Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST} intent. @hide */ EXTRA_ACCESS_REQUEST_TYPE : "android.bluetooth.device.extra.ACCESS_REQUEST_TYPE", /**@hide */ REQUEST_TYPE_PROFILE_CONNECTION : "1", /**@hide */ REQUEST_TYPE_PHONEBOOK_ACCESS : "2", /**@hide */ REQUEST_TYPE_MESSAGE_ACCESS : "3", /**@hide */ REQUEST_TYPE_SIM_ACCESS : "4", /** Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST} intents, Contains package name to return reply intent to. @hide */ EXTRA_PACKAGE_NAME : "android.bluetooth.device.extra.PACKAGE_NAME", /** Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST} intents, Contains class name to return reply intent to. @hide */ EXTRA_CLASS_NAME : "android.bluetooth.device.extra.CLASS_NAME", /** Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REPLY} intent. @hide */ EXTRA_CONNECTION_ACCESS_RESULT : "android.bluetooth.device.extra.CONNECTION_ACCESS_RESULT", /**@hide */ CONNECTION_ACCESS_YES : "1", /**@hide */ CONNECTION_ACCESS_NO : "2", /** Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REPLY} intents, Contains boolean to indicate if the allowed response is once-for-all so that next request will be granted without asking user again. @hide */ EXTRA_ALWAYS_ALLOWED : "android.bluetooth.device.extra.ALWAYS_ALLOWED", /** A bond attempt succeeded @hide */ BOND_SUCCESS : "0", /** A bond attempt failed because pins did not match, or remote device did not respond to pin request in time @hide */ UNBOND_REASON_AUTH_FAILED : "1", /** A bond attempt failed because the other side explicitly rejected bonding @hide */ UNBOND_REASON_AUTH_REJECTED : "2", /** A bond attempt failed because we canceled the bonding process @hide */ UNBOND_REASON_AUTH_CANCELED : "3", /** A bond attempt failed because we could not contact the remote device @hide */ UNBOND_REASON_REMOTE_DEVICE_DOWN : "4", /** A bond attempt failed because a discovery is in progress @hide */ UNBOND_REASON_DISCOVERY_IN_PROGRESS : "5", /** A bond attempt failed because of authentication timeout @hide */ UNBOND_REASON_AUTH_TIMEOUT : "6", /** A bond attempt failed because of repeated attempts @hide */ UNBOND_REASON_REPEATED_ATTEMPTS : "7", /** A bond attempt failed because we received an Authentication Cancel by remote end @hide */ UNBOND_REASON_REMOTE_AUTH_CANCELED : "8", /** An existing bond was explicitly revoked @hide */ UNBOND_REASON_REMOVED : "9", /** The user will be prompted to enter a pin or an app will enter a pin for user. */ PAIRING_VARIANT_PIN : "0", /** The user will be prompted to enter a passkey @hide */ PAIRING_VARIANT_PASSKEY : "1", /** The user will be prompted to confirm the passkey displayed on the screen or an app will confirm the passkey for the user. */ PAIRING_VARIANT_PASSKEY_CONFIRMATION : "2", /** The user will be prompted to accept or deny the incoming pairing request @hide */ PAIRING_VARIANT_CONSENT : "3", /** The user will be prompted to enter the passkey displayed on remote device This is used for Bluetooth 2.1 pairing. @hide */ PAIRING_VARIANT_DISPLAY_PASSKEY : "4", /** The user will be prompted to enter the PIN displayed on remote device. This is used for Bluetooth 2.0 pairing. @hide */ PAIRING_VARIANT_DISPLAY_PIN : "5", /** The user will be prompted to accept or deny the OOB pairing request @hide */ PAIRING_VARIANT_OOB_CONSENT : "6", /** The user will be prompted to enter a 16 digit pin or an app will enter a 16 digit pin for user. @hide */ PAIRING_VARIANT_PIN_16_DIGITS : "7", /** Used as an extra field in {@link #ACTION_UUID} intents, Contains the {@link android.os.ParcelUuid}s of the remote device which is a parcelable version of {@link UUID}. */ EXTRA_UUID : "android.bluetooth.device.extra.UUID", /**@hide */ EXTRA_SDP_RECORD : "android.bluetooth.device.extra.SDP_RECORD", /**@hide */ EXTRA_SDP_SEARCH_STATUS : "android.bluetooth.device.extra.SDP_SEARCH_STATUS", /** For {@link #getPhonebookAccessPermission}, {@link #setPhonebookAccessPermission}, {@link #getMessageAccessPermission} and {@link #setMessageAccessPermission}. @hide */ ACCESS_UNKNOWN : "0", /** For {@link #getPhonebookAccessPermission}, {@link #setPhonebookAccessPermission}, {@link #getMessageAccessPermission} and {@link #setMessageAccessPermission}. @hide */ ACCESS_ALLOWED : "1", /** For {@link #getPhonebookAccessPermission}, {@link #setPhonebookAccessPermission}, {@link #getMessageAccessPermission} and {@link #setMessageAccessPermission}. @hide */ ACCESS_REJECTED : "2", /** No preference of physical transport for GATT connections to remote dual-mode devices */ TRANSPORT_AUTO : "0", /** Prefer BR/EDR transport for GATT connections to remote dual-mode devices */ TRANSPORT_BREDR : "1", /** Prefer LE transport for GATT connections to remote dual-mode devices */ TRANSPORT_LE : "2", /** Bluetooth LE 1M PHY. Used to refer to LE 1M Physical Channel for advertising, scanning or connection. */ PHY_LE_1M : "1", /** Bluetooth LE 2M PHY. Used to refer to LE 2M Physical Channel for advertising, scanning or connection. */ PHY_LE_2M : "2", /** Bluetooth LE Coded PHY. Used to refer to LE Coded Physical Channel for advertising, scanning or connection. */ PHY_LE_CODED : "3", /** Bluetooth LE 1M PHY mask. Used to specify LE 1M Physical Channel as one of many available options in a bitmask. */ PHY_LE_1M_MASK : "1", /** Bluetooth LE 2M PHY mask. Used to specify LE 2M Physical Channel as one of many available options in a bitmask. */ PHY_LE_2M_MASK : "2", /** Bluetooth LE Coded PHY mask. Used to specify LE Coded Physical Channel as one of many available options in a bitmask. */ PHY_LE_CODED_MASK : "4", /** No preferred coding when transmitting on the LE Coded PHY. */ PHY_OPTION_NO_PREFERRED : "0", /** Prefer the S=2 coding to be used when transmitting on the LE Coded PHY. */ PHY_OPTION_S2 : "1", /** Prefer the S=8 coding to be used when transmitting on the LE Coded PHY. */ PHY_OPTION_S8 : "2", /**@hide */ EXTRA_MAS_INSTANCE : "android.bluetooth.device.extra.MAS_INSTANCE", /***/ CREATOR : "null", /** */ equals : function( ) {}, /** */ hashCode : function( ) {}, /**Returns a string representation of this BluetoothDevice. <p>Currently this is the Bluetooth hardware address, for example "00:11:22:AA:BB:CC". However, you should always use {@link #getAddress} if you explicitly require the Bluetooth hardware address in case the {@link #toString} representation changes in the future. @return {String} string representation of this BluetoothDevice */ toString : function( ) {}, /** */ describeContents : function( ) {}, /** */ writeToParcel : function( ) {}, /**Returns the hardware address of this BluetoothDevice. <p> For example, "00:11:22:AA:BB:CC". @return {String} Bluetooth hardware address as string */ getAddress : function( ) {}, /**Get the friendly Bluetooth name of the remote device. <p>The local adapter will automatically retrieve remote names when performing a device scan, and will cache them. This method just returns the name for this device from the cache. @return {String} the Bluetooth name, or null if there was a problem. */ getName : function( ) {}, /**Get the Bluetooth device type of the remote device. @return {Number} the device type {@link #DEVICE_TYPE_CLASSIC}, {@link #DEVICE_TYPE_LE} {@link #DEVICE_TYPE_DUAL}. {@link #DEVICE_TYPE_UNKNOWN} if it's not available */ getType : function( ) {}, /**Get the Bluetooth alias of the remote device. <p>Alias is the locally modified name of a remote device. @return {String} the Bluetooth alias, or null if no alias or there was a problem @hide */ getAlias : function( ) {}, /**Set the Bluetooth alias of the remote device. <p>Alias is the locally modified name of a remote device. <p>This methoid overwrites the alias. The changed alias is saved in the local storage so that the change is preserved over power cycle. @return {Boolean} true on success, false on error @hide */ setAlias : function( ) {}, /**Get the Bluetooth alias of the remote device. If Alias is null, get the Bluetooth name instead. @return {String} the Bluetooth alias, or null if no alias or there was a problem @hide @see #getAlias() @see #getName() */ getAliasName : function( ) {}, /**Get the most recent identified battery level of this Bluetooth device <p>Requires {@link android.Manifest.permission#BLUETOOTH} @return {Number} Battery level in percents from 0 to 100, or {@link #BATTERY_LEVEL_UNKNOWN} if Bluetooth is disabled, or device is disconnected, or does not have any battery reporting service, or return value is invalid @hide */ getBatteryLevel : function( ) {}, /**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. @return {Boolean} false on immediate error, true if bonding will begin */ createBond : function( ) {}, /**Start the bonding (pairing) process with the remote device using the specified transport. <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}. @param {Number} transport The transport to use for the pairing procedure. @return {Boolean} false on immediate error, true if bonding will begin @throws IllegalArgumentException if an invalid transport was specified @hide */ createBond : function( ) {}, /**Start the bonding (pairing) process with the remote device using the Out Of Band mechanism. <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}. @param {Number} transport - Transport to use @param {Object {OobData}} oobData - Out Of Band data @return {Boolean} false on immediate error, true if bonding will begin @hide */ createBondOutOfBand : function( ) {}, /** @hide */ isBondingInitiatedLocally : function( ) {}, /**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 trusted channels <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. @param {Object {byte[]}} hash Simple Secure pairing hash @param {Object {byte[]}} randomizer The random key obtained using OOB @return {Boolean} false on error; true otherwise @hide */ setDeviceOutOfBandData : function( ) {}, /**Cancel an in-progress bonding request started with {@link #createBond}. <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. @return {Boolean} true on success, false on error @hide */ cancelBondProcess : function( ) {}, /**Remove bond (pairing) with the remote device. <p>Delete the link key associated with the remote device, and immediately terminate connections to that device that require authentication and encryption. <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. @return {Boolean} true on success, false on error @hide */ removeBond : function( ) {}, /**Get the bond state of the remote device. <p>Possible values for the bond state are: {@link #BOND_NONE}, {@link #BOND_BONDING}, {@link #BOND_BONDED}. @return {Number} the bond state */ getBondState : function( ) {}, /**Returns whether there is an open connection to this device. <p>Requires {@link android.Manifest.permission#BLUETOOTH}. @return {Boolean} True if there is at least one open connection to this device. @hide */ isConnected : function( ) {}, /**Returns whether there is an open connection to this device that has been encrypted. <p>Requires {@link android.Manifest.permission#BLUETOOTH}. @return {Boolean} True if there is at least one encrypted connection to this device. @hide */ isEncrypted : function( ) {}, /**Get the Bluetooth class of the remote device. @return {Object {android.bluetooth.BluetoothClass}} Bluetooth class object, or null on error */ getBluetoothClass : function( ) {}, /**Returns the supported features (UUIDs) of the remote device. <p>This method does not start a service discovery procedure to retrieve the UUIDs from the remote device. Instead, the local cached copy of the service UUIDs are returned. <p>Use {@link #fetchUuidsWithSdp} if fresh UUIDs are desired. @return {Object {android.os.ParcelUuid}} the supported features (UUIDs) of the remote device, or null on error */ getUuids : function( ) {}, /**Perform a service discovery on the remote device to get the UUIDs supported. <p>This API is asynchronous and {@link #ACTION_UUID} intent is sent, with the UUIDs supported by the remote end. If there is an error in getting the SDP records or if the process takes a long time, {@link #ACTION_UUID} intent is sent with the UUIDs that is currently present in the cache. Clients should use the {@link #getUuids} to get UUIDs if service discovery is not to be performed. @return {Boolean} False if the sanity check fails, True if the process of initiating an ACL connection to the remote device was started. */ fetchUuidsWithSdp : function( ) {}, /** @hide */ sdpSearch : function( ) {}, /**Set the pin during pairing when the pairing method is {@link #PAIRING_VARIANT_PIN} <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. @return {Boolean} true pin has been set false for error */ setPin : function( ) {}, /** @hide */ setPasskey : function( ) {}, /**Confirm passkey for {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION} pairing. @return {Boolean} true confirmation has been sent out false for error */ setPairingConfirmation : function( ) {}, /** @hide */ setRemoteOutOfBandData : function( ) {}, /** @hide */ cancelPairingUserInput : function( ) {}, /** @hide */ isBluetoothDock : function( ) {}, /**Requires {@link android.Manifest.permission#BLUETOOTH}. @return {Number} Whether the phonebook access is allowed to this device. Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @hide */ getPhonebookAccessPermission : function( ) {}, /**Sets whether the {@link android.bluetooth.BluetoothDevice} enters silence mode. Audio will not be routed to the {@link android.bluetooth.BluetoothDevice} if set to {@code true}. When the {@link android.bluetooth.BluetoothDevice} enters silence mode, and the {@link android.bluetooth.BluetoothDevice} is an active device (for A2DP or HFP), the active device for that profile will be set to null. If the {@link android.bluetooth.BluetoothDevice} exits silence mode while the A2DP or HFP active device is null, the {@link android.bluetooth.BluetoothDevice} will be set as the active device for that profile. If the {@link android.bluetooth.BluetoothDevice} is disconnected, it exits silence mode. If the {@link android.bluetooth.BluetoothDevice} is set as the active device for A2DP or HFP, while silence mode is enabled, then the device will exit silence mode. If the {@link android.bluetooth.BluetoothDevice} is in silence mode, AVRCP position change event and HFP AG indicators will be disabled. If the {@link android.bluetooth.BluetoothDevice} is not connected with A2DP or HFP, it cannot enter silence mode. <p> Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. @param {Boolean} silence true to enter silence mode, false to exit @return {Boolean} true on success, false on error. @throws IllegalStateException if Bluetooth is not turned ON. @hide */ setSilenceMode : function( ) {}, /**Check whether the {@link android.bluetooth.BluetoothDevice} is in silence mode <p> Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. @return {Boolean} true on device in silence mode, otherwise false. @throws IllegalStateException if Bluetooth is not turned ON. @hide */ isInSilenceMode : function( ) {}, /**Sets whether the phonebook access is allowed to this device. <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. @param {Number} value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @return {Boolean} Whether the value has been successfully set. @hide */ setPhonebookAccessPermission : function( ) {}, /**Requires {@link android.Manifest.permission#BLUETOOTH}. @return {Number} Whether the message access is allowed to this device. Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @hide */ getMessageAccessPermission : function( ) {}, /**Sets whether the message access is allowed to this device. <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. @param {Number} value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @return {Boolean} Whether the value has been successfully set. @hide */ setMessageAccessPermission : function( ) {}, /**Requires {@link android.Manifest.permission#BLUETOOTH}. @return {Number} Whether the Sim access is allowed to this device. Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @hide */ getSimAccessPermission : function( ) {}, /**Sets whether the Sim access is allowed to this device. <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. @param {Number} value Can be {@link #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. @return {Boolean} Whether the value has been successfully set. @hide */ setSimAccessPermission : function( ) {}, /**Create an RFCOMM {@link android.bluetooth.BluetoothSocket} ready to start a secure outgoing connection to this remote device on given channel. <p>The remote device will be authenticated and communication on this socket will be encrypted. <p> Use this socket only if an authenticated socket link is possible. Authentication refers to the authentication of the link key to prevent man-in-the-middle type of attacks. For example, for Bluetooth 2.1 devices, if any of the devices does not have an input and output capability or just has the ability to display a numeric key, a secure socket connection is not possible. In such a case, use {@link createInsecureRfcommSocket}. For more details, refer to the Security Model section 5.2 (vol 3) of Bluetooth Core Specification version 2.1 + EDR. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. <p>Valid RFCOMM channels are in range 1 to 30. <p>Requires {@link android.Manifest.permission#BLUETOOTH} @param {Number} channel RFCOMM channel to connect to @return {Object {android.bluetooth.BluetoothSocket}} a RFCOMM BluetoothServerSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions @hide */ createRfcommSocket : function( ) {}, /**Create an L2cap {@link android.bluetooth.BluetoothSocket} ready to start a secure outgoing connection to this remote device on given channel. <p>The remote device will be authenticated and communication on this socket will be encrypted. <p> Use this socket only if an authenticated socket link is possible. Authentication refers to the authentication of the link key to prevent man-in-the-middle type of attacks. For example, for Bluetooth 2.1 devices, if any of the devices does not have an input and output capability or just has the ability to display a numeric key, a secure socket connection is not possible. In such a case, use {@link createInsecureRfcommSocket}. For more details, refer to the Security Model section 5.2 (vol 3) of Bluetooth Core Specification version 2.1 + EDR. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. <p>Valid L2CAP PSM channels are in range 1 to 2^16. <p>Requires {@link android.Manifest.permission#BLUETOOTH} @param {Number} channel L2cap PSM/channel to connect to @return {Object {android.bluetooth.BluetoothSocket}} a RFCOMM BluetoothServerSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions @hide */ createL2capSocket : function( ) {}, /**Create an L2cap {@link android.bluetooth.BluetoothSocket} ready to start an insecure outgoing connection to this remote device on given channel. <p>The remote device will be not authenticated and communication on this socket will not be encrypted. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. <p>Valid L2CAP PSM channels are in range 1 to 2^16. <p>Requires {@link android.Manifest.permission#BLUETOOTH} @param {Number} channel L2cap PSM/channel to connect to @return {Object {android.bluetooth.BluetoothSocket}} a RFCOMM BluetoothServerSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions @hide */ createInsecureL2capSocket : function( ) {}, /**Create an RFCOMM {@link android.bluetooth.BluetoothSocket} ready to start a secure outgoing connection to this remote device using SDP lookup of uuid. <p>This is designed to be used with {@link android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord} for peer-peer Bluetooth applications. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. This will also perform an SDP lookup of the given uuid to determine which channel to connect to. <p>The remote device will be authenticated and communication on this socket will be encrypted. <p> Use this socket only if an authenticated socket link is possible. Authentication refers to the authentication of the link key to prevent man-in-the-middle type of attacks. For example, for Bluetooth 2.1 devices, if any of the devices does not have an input and output capability or just has the ability to display a numeric key, a secure socket connection is not possible. In such a case, use {@link #createInsecureRfcommSocketToServiceRecord}. For more details, refer to the Security Model section 5.2 (vol 3) of Bluetooth Core Specification version 2.1 + EDR. <p>Hint: If you are connecting to a Bluetooth serial board then try using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. However if you are connecting to an Android peer then please generate your own unique UUID. @param {Object {UUID}} uuid service record uuid to lookup RFCOMM channel @return {Object {android.bluetooth.BluetoothSocket}} a RFCOMM BluetoothServerSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions */ createRfcommSocketToServiceRecord : function( ) {}, /**Create an RFCOMM {@link android.bluetooth.BluetoothSocket} socket ready to start an insecure outgoing connection to this remote device using SDP lookup of uuid. <p> The communication channel will not have an authenticated link key i.e it will be subject to man-in-the-middle attacks. For Bluetooth 2.1 devices, the link key will be encrypted, as encryption is mandatory. For legacy devices (pre Bluetooth 2.1 devices) the link key will be not be encrypted. Use {@link #createRfcommSocketToServiceRecord} if an encrypted and authenticated communication channel is desired. <p>This is designed to be used with {@link android.bluetooth.BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord} for peer-peer Bluetooth applications. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. This will also perform an SDP lookup of the given uuid to determine which channel to connect to. <p>The remote device will be authenticated and communication on this socket will be encrypted. <p>Hint: If you are connecting to a Bluetooth serial board then try using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. However if you are connecting to an Android peer then please generate your own unique UUID. @param {Object {UUID}} uuid service record uuid to lookup RFCOMM channel @return {Object {android.bluetooth.BluetoothSocket}} a RFCOMM BluetoothServerSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions */ createInsecureRfcommSocketToServiceRecord : function( ) {}, /**Construct an insecure RFCOMM socket ready to start an outgoing connection. Call #connect on the returned #BluetoothSocket to begin the connection. The remote device will not be authenticated and communication on this socket will not be encrypted. <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} @param {Number} port remote port @return {Object {android.bluetooth.BluetoothSocket}} An RFCOMM BluetoothSocket @throws IOException On error, for example Bluetooth not available, or insufficient permissions. @hide */ createInsecureRfcommSocket : function( ) {}, /**Construct a SCO socket ready to start an outgoing connection. Call #connect on the returned #BluetoothSocket to begin the connection. <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} @return {Object {android.bluetooth.BluetoothSocket}} a SCO BluetoothSocket @throws IOException on error, for example Bluetooth not available, or insufficient permissions. @hide */ createScoSocket : function( ) {}, /**Check that a pin is valid and convert to byte array. Bluetooth pin's are 1 to 16 bytes of UTF-8 characters. @param {String} pin pin as java String @return {Number} the pin code as a UTF-8 byte array, or null if it is an invalid Bluetooth pin. @hide */ convertPinToBytes : function( ) {}, /**Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @param {Object {Context}} callback GATT callback handler that will receive asynchronous callbacks. @param {Boolean} autoConnect Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). @throws IllegalArgumentException if callback is null */ connectGatt : function( ) {}, /**Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @param {Object {Context}} callback GATT callback handler that will receive asynchronous callbacks. @param {Boolean} autoConnect Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). @param {Object {BluetoothGattCallback}} transport preferred transport for GATT connections to remote dual-mode devices {@link BluetoothDevice#TRANSPORT_AUTO} or {@link BluetoothDevice#TRANSPORT_BREDR} or {@link BluetoothDevice#TRANSPORT_LE} @throws IllegalArgumentException if callback is null */ connectGatt : function( ) {}, /**Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @param {Object {Context}} callback GATT callback handler that will receive asynchronous callbacks. @param {Boolean} autoConnect Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). @param {Object {BluetoothGattCallback}} transport preferred transport for GATT connections to remote dual-mode devices {@link BluetoothDevice#TRANSPORT_AUTO} or {@link BluetoothDevice#TRANSPORT_BREDR} or {@link BluetoothDevice#TRANSPORT_LE} @param {Number} phy preferred PHY for connections to remote LE device. Bitwise OR of any of {@link BluetoothDevice#PHY_LE_1M_MASK}, {@link BluetoothDevice#PHY_LE_2M_MASK}, and {@link BluetoothDevice#PHY_LE_CODED_MASK}. This option does not take effect if {@code autoConnect} is set to true. @throws NullPointerException if callback is null */ connectGatt : function( ) {}, /**Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @param {Object {Context}} callback GATT callback handler that will receive asynchronous callbacks. @param {Boolean} autoConnect Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). @param {Object {BluetoothGattCallback}} transport preferred transport for GATT connections to remote dual-mode devices {@link BluetoothDevice#TRANSPORT_AUTO} or {@link BluetoothDevice#TRANSPORT_BREDR} or {@link BluetoothDevice#TRANSPORT_LE} @param {Number} phy preferred PHY for connections to remote LE device. Bitwise OR of any of {@link BluetoothDevice#PHY_LE_1M_MASK}, {@link BluetoothDevice#PHY_LE_2M_MASK}, an d{@link BluetoothDevice#PHY_LE_CODED_MASK}. This option does not take effect if {@code autoConnect} is set to true. @param {Number} handler The handler to use for the callback. If {@code null}, callbacks will happen on an un-specified background thread. @throws NullPointerException if callback is null */ connectGatt : function( ) {}, /**Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @param {Object {Context}} callback GATT callback handler that will receive asynchronous callbacks. @param {Boolean} autoConnect Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). @param {Object {BluetoothGattCallback}} transport preferred transport for GATT connections to remote dual-mode devices {@link BluetoothDevice#TRANSPORT_AUTO} or {@link BluetoothDevice#TRANSPORT_BREDR} or {@link BluetoothDevice#TRANSPORT_LE} @param {Number} opportunistic Whether this GATT client is opportunistic. An opportunistic GATT client does not hold a GATT connection. It automatically disconnects when no other GATT connections are active for the remote device. @param {Boolean} phy preferred PHY for connections to remote LE device. Bitwise OR of any of {@link BluetoothDevice#PHY_LE_1M_MASK}, {@link BluetoothDevice#PHY_LE_2M_MASK}, an d{@link BluetoothDevice#PHY_LE_CODED_MASK}. This option does not take effect if {@code autoConnect} is set to true. @param {Number} handler The handler to use for the callback. If {@code null}, callbacks will happen on an un-specified background thread. @return {Object {android.bluetooth.BluetoothGatt}} A BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. @hide */ connectGatt : function( ) {}, /**Create a Bluetooth L2CAP Connection-oriented Channel (CoC) {@link android.bluetooth.BluetoothSocket} that can be used to start a secure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value. The supported Bluetooth transport is LE only. <p>This is designed to be used with {@link android.bluetooth.BluetoothAdapter#listenUsingL2capChannel()} for peer-peer Bluetooth applications. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. <p>Application using this API is responsible for obtaining PSM value from remote device. <p>The remote device will be authenticated and communication on this socket will be encrypted. <p> Use this socket if an authenticated socket link is possible. Authentication refers to the authentication of the link key to prevent man-in-the-middle type of attacks. @param {Number} psm dynamic PSM value from remote device @return {Object {android.bluetooth.BluetoothSocket}} a CoC #BluetoothSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions */ createL2capChannel : function( ) {}, /**TODO: Remove this hidden method once all the SL4A and other tests are updated to use the new API name, createL2capChannel. @hide */ createL2capCocSocket : function( ) {}, /**Create a Bluetooth L2CAP Connection-oriented Channel (CoC) {@link android.bluetooth.BluetoothSocket} that can be used to start a secure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value. The supported Bluetooth transport is LE only. <p>This is designed to be used with {@link android.bluetooth.BluetoothAdapter#listenUsingInsecureL2capChannel()} for peer-peer Bluetooth applications. <p>Use {@link android.bluetooth.BluetoothSocket#connect} to initiate the outgoing connection. <p>Application using this API is responsible for obtaining PSM value from remote device. <p> The communication channel may not have an authenticated link key, i.e. it may be subject to man-in-the-middle attacks. Use {@link #createL2capChannel(int)} if an encrypted and authenticated communication channel is possible. @param {Number} psm dynamic PSM value from remote device @return {Object {android.bluetooth.BluetoothSocket}} a CoC #BluetoothSocket ready for an outgoing connection @throws IOException on error, for example Bluetooth not available, or insufficient permissions */ createInsecureL2capChannel : function( ) {}, /**TODO: Remove this hidden method once all the SL4A and other tests are updated to use the new API name, createInsecureL2capChannel. @hide */ createInsecureL2capCocSocket : function( ) {}, /**Set a keyed metadata of this {@link android.bluetooth.BluetoothDevice} to a {@link String} value. Only bonded devices's metadata will be persisted across Bluetooth restart. Metadata will be removed when the device's bond state is moved to {@link #BOND_NONE}. @param {Number} key must be within the list of BluetoothDevice.METADATA_* @param {Object {byte[]}} value a byte array data to set for key. Must be less than {@link BluetoothAdapter#METADATA_MAX_LENGTH} characters in length @return {Boolean} true on success, false on error @hide */ setMetadata : function( ) {}, /**Get a keyed metadata for this {@link android.bluetooth.BluetoothDevice} as {@link String} @param {Number} key must be within the list of BluetoothDevice.METADATA_* @return {Number} Metadata of the key as byte array, null on error or not found @hide */ getMetadata : function( ) {}, };