API reference

MockDeviceKitInterface Interface

Suite for device simulation and mocking in the DAT SDK.
This interface defines the contract for managing simulated Meta Wearables devices. Use MockDeviceKit.getInstance to obtain an implementation for testing scenarios where real hardware is not available.
Example:
val mockKit = MockDeviceKit.getInstance(context)
mockKit.pairGlasses(GlassesModel.RAYBAN_META).fold(
    onSuccess = { glasses ->
        glasses.powerOn()
        glasses.unfold()
    },
    onFailure = { error, _ -> Log.e("MockKit", "$error") },
)

See Also

  • MockDeviceKit for the concrete implementation
  • MockDevice for base device operations
  • MockGlasses for glasses-specific functionality

Signature

interface MockDeviceKitInterface

Properties

isEnabled : Boolean
[Get]
Whether MockDeviceKit is currently enabled with fake implementations attached.
Signature
abstract val isEnabled: Boolean
pairedDevices : Collection
[Get]
List of currently paired mock devices.
Signature
abstract val pairedDevices: Collection<MockDevice>
permissions : MockPermissions
[Get]
Controls mock permission behavior for Wearables.checkPermissionStatus and Wearables.RequestPermissionContract.
Signature
abstract val permissions: MockPermissions

Methods

disable ()
Disable MockDeviceKit. Detaches fake implementations, unpairs all mock devices, and restores real registration and device connectivity stack.
Signature
abstract fun disable()
enable ( config )
Enable MockDeviceKit. Attaches fake implementations for registration and device connectivity.
By default, Wearables.registrationState will transition to RegistrationState.Registered. Pass MockDeviceKitConfig with MockDeviceKitConfig.initiallyRegistered set to false to start in an unregistered state instead.
Safe to call regardless of whether Wearables.initialize has been called — MockDeviceKit will auto-initialize Wearables if needed.
Signature
abstract fun enable(config: MockDeviceKitConfig = MockDeviceKitConfig())
Parameters
config: MockDeviceKitConfig  Configuration controlling initial mock behavior. Defaults to registered start.
pairGlasses ( model )
Pairs a simulated glasses device of the given model.
Signature
abstract fun pairGlasses(model: GlassesModel): DatResult<MockGlasses, MockDeviceKitError>
Parameters
model: GlassesModel  The glasses model to simulate
Returns
DatResult DatResult containing the paired MockGlasses, or MockDeviceKitError.NotEnabled if MockDeviceKit has not been enabled
unpairDevice ( device )
Unpairs and removes a simulated device from the mock environment.
Signature
abstract fun unpairDevice(device: MockDevice)
Parameters
device: MockDevice  The mock device to unpair