CrashDetectionApi

CrashDetectionApi

invokeDummyVehicleCrash()

void invokeDummyVehicleCrash()

Invokes a dummy vehicle crash event. Use this method to test your vehicle crash detection integration.

Calling this method will invoke the VehicleCrashListener#onVehicleCrash(VehicleCrashEvent) method of your VehicleCrashListener implementation, set via setVehicleCrashListener(VehicleCrashListener).

Note that this method is intended for testing your integration, and will only run on debug versions of your app (i.e. when the android:debuggable manifest flag is set to true).

isVehicleCrashDetectionSupported()

boolean isVehicleCrashDetectionSupported()

Returns whether vehicle crash detection is supported on the device.

The result depends on multiple criteria, such as if vehicle crash detection is enabled for your app, and if the necessary sensors are present on the device.

setVehicleCrashDiagnosticListener()

void setVehicleCrashDiagnosticListener(@Nullable final VehicleCrashDiagnosticListener listener);

Sets a listener that is invoked when vehicle crash diagnostic data becomes available.

Use this method to receive diagnostic data while vehicle crash detection is running.

Parameters

listener

the VehicleCrashDiagnosticListener to receive diagnostic data. Set null to remove the previously set listener.

setVehicleCrashListener()

void setVehicleCrashListener(@Nullable VehicleCrashListener listener)

Sets a listener that is invoked when a vehicle crash is detected.

Parameters

listener

A VehicleCrashListener to receive details about the crash. Set null to remove the previously set listener.

Last updated