@Implements(value=android.bluetooth.BluetoothAdapter.class) public class ShadowBluetoothAdapter extends java.lang.Object
Constructor and Description |
---|
ShadowBluetoothAdapter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
cancelDiscovery() |
protected static boolean |
checkBluetoothAddress(java.lang.String address)
Validate a Bluetooth address, such as “00:43:A8:23:10:F0” Alphabetic characters must be uppercase to be valid.
|
protected boolean |
disable() |
protected boolean |
enable() |
protected java.lang.String |
getAddress() |
protected java.util.Set<android.bluetooth.BluetoothDevice> |
getBondedDevices() |
protected static android.bluetooth.BluetoothAdapter |
getDefaultAdapter() |
java.util.Set<android.bluetooth.BluetoothAdapter.LeScanCallback> |
getLeScanCallbacks() |
protected java.lang.String |
getName() |
protected int |
getProfileConnectionState(int profile)
Returns the connection state for the given Bluetooth
profile , defaulting to BluetoothProfile.STATE_DISCONNECTED if the profile’s connection state was never set. |
protected int |
getScanMode() |
android.bluetooth.BluetoothAdapter.LeScanCallback |
getSingleLeScanCallback() |
protected int |
getState() |
protected boolean |
isDiscovering() |
protected boolean |
isEnabled() |
protected boolean |
isMultipleAdvertisementSupported() |
protected android.bluetooth.BluetoothServerSocket |
listenUsingInsecureRfcommWithServiceRecord(java.lang.String serviceName,
java.util.UUID uuid) |
void |
setAddress(java.lang.String address) |
void |
setBondedDevices(java.util.Set<android.bluetooth.BluetoothDevice> bluetoothDevices) |
void |
setEnabled(boolean enabled) |
void |
setIsMultipleAdvertisementSupported(boolean supported) |
protected boolean |
setName(java.lang.String name) |
void |
setProfileConnectionState(int profile,
int state)
Sets the connection state
state for the given BLuetoothProfile profile |
protected boolean |
setScanMode(int scanMode) |
void |
setState(int state) |
protected boolean |
startDiscovery() |
protected boolean |
startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback) |
protected boolean |
startLeScan(java.util.UUID[] serviceUuids,
android.bluetooth.BluetoothAdapter.LeScanCallback callback) |
protected void |
stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback) |
@Implementation protected static android.bluetooth.BluetoothAdapter getDefaultAdapter()
@Implementation protected java.util.Set<android.bluetooth.BluetoothDevice> getBondedDevices()
public void setBondedDevices(java.util.Set<android.bluetooth.BluetoothDevice> bluetoothDevices)
@Implementation protected android.bluetooth.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(java.lang.String serviceName, java.util.UUID uuid)
@Implementation protected boolean startDiscovery()
@Implementation protected boolean cancelDiscovery()
@Implementation(minSdk=18) protected boolean startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback)
@Implementation(minSdk=18) protected boolean startLeScan(java.util.UUID[] serviceUuids, android.bluetooth.BluetoothAdapter.LeScanCallback callback)
@Implementation(minSdk=18) protected void stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback)
public java.util.Set<android.bluetooth.BluetoothAdapter.LeScanCallback> getLeScanCallbacks()
public android.bluetooth.BluetoothAdapter.LeScanCallback getSingleLeScanCallback()
@Implementation protected boolean isDiscovering()
@Implementation protected boolean isEnabled()
@Implementation protected boolean enable()
@Implementation protected boolean disable()
@Implementation protected java.lang.String getAddress()
@Implementation protected int getState()
@Implementation protected java.lang.String getName()
@Implementation protected boolean setName(java.lang.String name)
@Implementation protected boolean setScanMode(int scanMode)
@Implementation protected int getScanMode()
@Implementation(minSdk=21) protected boolean isMultipleAdvertisementSupported()
@Implementation protected static boolean checkBluetoothAddress(java.lang.String address)
Validate a Bluetooth address, such as “00:43:A8:23:10:F0” Alphabetic characters must be uppercase to be valid.
address
- Bluetooth address as string@Implementation protected int getProfileConnectionState(int profile)
Returns the connection state for the given Bluetooth profile
, defaulting to BluetoothProfile.STATE_DISCONNECTED
if the profile’s connection state was never set.
Set a Bluetooth profile’s connection state via setProfileConnectionState(int, int)
.
public void setAddress(java.lang.String address)
public void setState(int state)
public void setEnabled(boolean enabled)
public void setIsMultipleAdvertisementSupported(boolean supported)
public void setProfileConnectionState(int profile, int state)
Sets the connection state state
for the given BLuetoothProfile profile