Safe
Rider
Types
Listener for fall survey answers after the accident workflow
Listener for protection status changes
Properties
Functions
Add a listener for protection status changes The listener will be notified when the protection status changes
Add a listener for trip detection events
Cancel the emergency request Do nothing if the is no current emergency request This method should not be handled by the client if @property showAccidentUi is set to true as the library will handle it.
Disable trip detection
Enable trip detection Trip detection will scan the user activity to detect trips for the given vehicle type. When a trip is detected, the library will notify the client with the detected vehicle by calling the LRTripDetectionListener.onTripDetected(vehicleType) method for registered listeners. This method will check if the required permissions are granted before enabling trip detection. If not, it will return an error. This state is persisted and will be restored when the application is killed and restarted so that the client doesn't need to enable trip detection again.
Get the intent to start the accident workflow activity Return the intent to start the accident workflow activity when an accident is detected.
Mute trip detection analysis When trip detection is muted, the library will not analyze the user activity to detect trips. This method should be used when the client doesn't need trip detection analysis for a certain period of time. For instance, when a trip has already been detected and the client doesn't want to detect another trip. The main difference with SafeRider.disableTripDetection() is that the trip detection service is still running but the analysis is muted so that application can be restored if it has been killed by the system, or if an accident has occurred.
Remove all protection status listeners
Remove a listener for protection status changes Stops receiving protection status changes for the given listener
Remove a listener for trip detection
Report an undetected accident during the protection session This method will upload session data buffers to the server
Resume to an active state after an emergency This method should not be handled by the client if @property showAccidentUi is set to true as the library will handle it. In scenarios where the client wants to handle the emergency state by itself, this method should be called to resume the protection at the end of the emergency worfklow.
Send a fake emergency request
Simulate a fake shock warning: this method should only be used for testing purposes
Stop the alert countdown after an accident detected This method should not be handled by the client if @property showAccidentUi is set to true as the library will handle it.
Stop the protection
Trigger a fake alert warning: this method should only be used for testing purposes
Trigger a fake detection analysis by emulating an activity recognition event warning: this method should only be used for testing purposes