MockEnvironment
A mock environment that can be used to test the behavior of the Central Manager.
Inheritors
Types
Android SDK versions.
A mock environment for Android 5.0 (Lollipop).
A mock environment for Android 6.0 (Marshmallow).
A mock environment for Android 8.0 (Oreo).
A mock environment for Android 12 (S).
Properties
A callback that will be called when the app requests to advertise. The callback should return the TX power level used for mock advertising.
The Android SDK version.
Whether the BLUETOOTH_ADVERTISE
permission is granted.
Whether the BLUETOOTH_CONNECT
permission is granted.
Whether the BLUETOOTH_SCAN
permission is granted.
Whether LE 2M PHY is supported on the device.
Whether LE Coded PHY is supported on the device.
Whether LE Extended Advertising feature is supported.
Whether location service is enabled on the device.
Whether the fine location permission is granted.
Whether location is required to scan for Bluetooth devices.
Whether multi advertisement is supported by the chipset.
Whether the device can scan for Bluetooth LE devices advertising on LE Coded PHY as Primary PHY.
The maximum LE advertising data length in bytes, if LE Extended Advertising feature is supported.
Whether the device requires runtime permissions to use Bluetooth.
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.