Api21

class Api21(deviceName: String = DEFAULT_NAME, isBluetoothSupported: Boolean = true, isBluetoothEnabled: Boolean = true, val isMultipleAdvertisementSupported: Boolean = true, val advertiser: MockAdvertiser = DEFAULT_MOCK_ADVERTISER, val scanner: MockScanner = DEFAULT_MOCK_SCANNER) : MockEnvironment

A mock environment for Android 5.0 (Lollipop).

Parameters

deviceName

The device name, by default set to "Mock".

isBluetoothSupported

Whether Bluetooth is supported on the device.

isBluetoothEnabled

Whether Bluetooth is enabled on the device.

isMultipleAdvertisementSupported

Whether multi advertisement is supported by the chipset.

advertiser

A callback that will be called when the app requests to advertise. The callback should return TX power level used for mock advertising.

scanner

A callback that will be called when the mock central manager requests to scan for devices. It returns whether the scan was successful, secretly failed, or returned an error.

Constructors

Link copied to clipboard
constructor(deviceName: String = DEFAULT_NAME, isBluetoothSupported: Boolean = true, isBluetoothEnabled: Boolean = true, isMultipleAdvertisementSupported: Boolean = true, advertiser: MockAdvertiser = DEFAULT_MOCK_ADVERTISER, scanner: MockScanner = DEFAULT_MOCK_SCANNER)

Properties

Link copied to clipboard

A callback that will be called when the app requests to advertise. The callback should return the TX power level used for mock advertising.

Link copied to clipboard

The Android SDK version.

Link copied to clipboard
Link copied to clipboard

Whether the BLUETOOTH_ADVERTISE permission is granted.

Link copied to clipboard

Whether the BLUETOOTH_CONNECT permission is granted.

Link copied to clipboard
Link copied to clipboard

Whether the BLUETOOTH_SCAN permission is granted.

Link copied to clipboard
Link copied to clipboard

Whether LE 2M PHY is supported on the device.

Link copied to clipboard

Whether LE Coded PHY is supported on the device.

Link copied to clipboard

Whether LE Extended Advertising feature is supported.

Link copied to clipboard

Whether location service is enabled on the device.

Link copied to clipboard

Whether the fine location permission is granted.

Link copied to clipboard

Whether location is required to scan for Bluetooth devices.

Link copied to clipboard

Whether multi advertisement is supported by the chipset.

Link copied to clipboard

Whether the device can scan for Bluetooth LE devices advertising on LE Coded PHY as Primary PHY.

Link copied to clipboard
val leMaximumAdvertisingDataLength: @Range(from = 31, to = 1650) Int = 31

The maximum LE advertising data length in bytes, if LE Extended Advertising feature is supported.

Link copied to clipboard

Whether the device requires runtime permissions to use Bluetooth.

Link copied to clipboard

A callback that will be called when the mock central manager requests to scan for devices. It returns whether the scan was successful, secretly failed, or returned an error.