Device.bluetoothUnpairAllHeadsets()
Overview
Removes the system pairing for all Bluetooth headset devices.
Added in version 2.1.33
Android only
Format
var available = Device.bluetoothUnpairAllHeadsets();
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
available | Indicates if the unpair process is available. | Boolean | Return value | A false return value indicates unpairing is unavailable at this time. |
Example
Copy
/* Tries to unpair all Bluetooth headset devices when the F1 key is pressed.
* Logs information on success or failure.
*/
WLEvent.onKey(0xE03B, function(event) {
var available = Device.bluetoothUnpairAllHeadsets();
if(!available) {
Logger.error("Cannot unpair right now");
}
event.eventHandled = true;
});