STWLone Worker Manager
STWLoneWorkerManager or
Class responsible to manage all lone worker services ( Man down, Positive security)
This class offers several possible operations defined in the following list:
- Start lone worker service
- Stop lone worker service
- Schedule lone worker service
- reCalibration
- Stop man down alert
- Acknowledge an man down alert
- Check services states
Start and check lone worker services
.......
STWLoneWorkerManager.getInstance().startLoneWorker(context, needToRestartService, loneWorkerStartCallback);
........
Content copied to clipboard
Stop lone worker service
......
STWLoneWorkerManager.getInstance().stopLoneWorker(context);
......
Content copied to clipboard
Schedule lone worker service
......
STWLoneWorkerManager.getInstance().scheduleLoneWorker(context, loneWorkerDelay, informServer);
......
Content copied to clipboard
reCalibration
......
STWLoneWorkerManager.getInstance().recalibrate(context, loneWorkerStartCallback);
......
Content copied to clipboard
Stop man down alert
.....
STWLoneWorkerManager.getInstance().stopManDownAlert(context);
........
Content copied to clipboard
.....
STWLoneWorkerManager.getInstance().stopManDownAlert(Context context , String threadId);
........
Content copied to clipboard
Acknowledge an man down alert
.....
STWLoneWorkerManager.getInstance().setManDownAlertAcknowledged(this, messageId);
........
Content copied to clipboard
Types
Functions
Link copied to clipboard
Use this method to cancel the current man down alert operation
Link copied to clipboard
Use this method to retrieve the current ManDown state
Link copied to clipboard
Link copied to clipboard
Use this method to retrieve the positive security connection lost time
Link copied to clipboard
Use this method retrieve the last threadID for the emergency man down alert
Link copied to clipboard
Use this method to retrieve the current preAlarm progress value and the preAlarm configured delay
Link copied to clipboard
open fun initLoneWorkerUserSettings(@NonNull loneWorkerUserSettingsConfig: LoneWorkerUserSettingsConfig)
Content copied to clipboard
Use this method to initialise the LoneWorker settings config
Link copied to clipboard
Use this method to check if the connection lost is detected or not
Link copied to clipboard
Link copied to clipboard
If the caliration is already Done
Link copied to clipboard
If the subscriber is allowed to use lone worker feature
Link copied to clipboard
Use this method to check if the caller phone is in the man down recipient call or not
Link copied to clipboard
If the subscriber is allowed to use man down feature
Link copied to clipboard
If the subscriber is allowed to use man down feature and ManDown detection recipient is not empty
Link copied to clipboard
If the subscriber is allowed to use positive security feature
Link copied to clipboard
Use this method when positive security alarm is acknowledged
Link copied to clipboard
open fun recalibrate(@NonNull context: Context, @Nullable callback: LoneWorkerStartCallback)
Content copied to clipboard
Use this method to restart the calibration phase again
Link copied to clipboard
open fun registerPreAlarmTimerObserver(@NonNull smartMSTimerObserver: SmartMSTimerObserver)
Content copied to clipboard
Use this method to listen for the ManDown PreAlarm timer
Link copied to clipboard
open fun registerToLoneWorkerEvent(@NonNull loneWorkerCallback: STWLoneWorkerManager.LoneWorkerCallback)
Content copied to clipboard
Register the specified listener to be notified by any Lone worker changes
Link copied to clipboard
open fun registerToManDownEvent(@NonNull manDownCallback: STWLoneWorkerManager.ManDownCallback)
Content copied to clipboard
Register the specified listener to be notified by any Man down changes
Link copied to clipboard
open fun registerToPositiveSecurityEvent(@NonNull positiveSecurityCallback: STWLoneWorkerManager.PositiveSecurityCallback)
Content copied to clipboard
Register the specified listener to be notified by any Positive security changes
Link copied to clipboard
open fun scheduleLoneWorker(@NonNull context: Context, loneWorkerDelay: Int)
Content copied to clipboard
open fun scheduleLoneWorker( @NonNull context: Context, loneWorkerDelay: Int, informServer: Boolean)
Content copied to clipboard
Use this method to schedule the start of the lone worker manager
Link copied to clipboard
open fun setManDownAlertAcknowledged(@NonNull context: Context, @NonNull message: BaseMessage)
Content copied to clipboard
Link copied to clipboard
open fun startLoneWorker( @NonNull context: Context, needToRestartService: Boolean, @Nullable callback: LoneWorkerStartCallback)
Content copied to clipboard
Use this method to start the lone worker service
open fun startLoneWorker( @NonNull context: Context, needToRestartService: Boolean, startCalibration: Boolean, phoneIsLocked: Boolean, @Nullable callback: LoneWorkerStartCallback)
Content copied to clipboard
Use this method to start the lone worker manager
Link copied to clipboard
Use this method to stop the lone worker manager
Link copied to clipboard
Use this method to stop the man down alert
open fun stopManDownAlert(@NonNull context: Context, @NonNull threadId: String)
Content copied to clipboard
Stop the man down alert corresponding the the specified thread
Link copied to clipboard
open fun unregisterLoneWorkerEvent(@NonNull loneWorkerCallback: STWLoneWorkerManager.LoneWorkerCallback)
Content copied to clipboard
Unregister the specified listener to not receive any more the Lone worker changes
Link copied to clipboard
open fun unregisterManDownEvent(@NonNull manDownCallback: STWLoneWorkerManager.ManDownCallback)
Content copied to clipboard
Unregister the specified listener to not receive any more the Man down changes
Link copied to clipboard
open fun unregisterPositiveSecurityEvent(@NonNull positiveSecurityCallback: STWLoneWorkerManager.PositiveSecurityCallback)
Content copied to clipboard
Unregister the specified listener to not receive any more the Positive security changes
Link copied to clipboard
open fun unregisterPreAlarmTimerObserver(@NonNull smartMSTimerObserver: SmartMSTimerObserver)
Content copied to clipboard
Use this method to remove the previously listener instance callback