Package org.robolectric.shadows
Class ShadowDistanceMeasurementManager
java.lang.Object
org.robolectric.shadows.ShadowDistanceMeasurementManager
@Implements(value=android.bluetooth.le.DistanceMeasurementManager.class,
minSdk=34,
isInAndroidSdk=false)
public class ShadowDistanceMeasurementManager
extends Object
Shadow implementation of
DistanceMeasurementManager
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<DistanceMeasurementMethod>
void
setSupportedMethods
(List<DistanceMeasurementMethod> methods) Sets a list of supportedDistanceMeasurementMethod
.void
simulateOnResult
(BluetoothDevice device, DistanceMeasurementResult result) void
simulateOnStartFailError
(BluetoothDevice device, int error) SimulatesDistanceMeasurementSession.Callback.onStartFail(int)
with an error.void
simulateOnStoppedError
(BluetoothDevice device, int error) SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
with an error.void
SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
without an error.void
simulateTimeout
(BluetoothDevice device) SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
after a timeout.protected CancellationSignal
startMeasurementSession
(DistanceMeasurementParams params, Executor executor, DistanceMeasurementSession.Callback callback)
-
Constructor Details
-
ShadowDistanceMeasurementManager
public ShadowDistanceMeasurementManager()
-
-
Method Details
-
getSupportedMethods
-
startMeasurementSession
@Implementation protected CancellationSignal startMeasurementSession(DistanceMeasurementParams params, Executor executor, DistanceMeasurementSession.Callback callback) -
simulateOnResult
- Parameters:
device
- RemoteBluetoothDevice
to which this device is measuring distance.result
-DistanceMeasurementResult
which should be passed to the callback.
-
simulateOnStartFailError
SimulatesDistanceMeasurementSession.Callback.onStartFail(int)
with an error.- Parameters:
device
- RemoteBluetoothDevice
to which this device is measuring distance.error
- Error to simulate. One ofDistanceMeasurementSession.Callback.Reason
.
-
simulateOnStoppedError
SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
with an error.- Parameters:
device
- RemoteBluetoothDevice
to which this device is measuring distance.error
- Error to simulate. One ofDistanceMeasurementSession.Callback.Reason
.
-
simulateSuccessfulTermination
SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
without an error.- Parameters:
device
- RemoteBluetoothDevice
to which this device is measuring distance.
-
simulateTimeout
SimulatesDistanceMeasurementSession.Callback.onStopped(DistanceMeasurementSession, int)
after a timeout. -
setSupportedMethods
Sets a list of supportedDistanceMeasurementMethod
.
-