Class TimeoutLockService
-
- All Implemented Interfaces:
public abstract class TimeoutLockService extends MobileService
Represents the abstract service to handle the case that when the app is put into background and brought up to the foreground, how to handle the timeout passcode policy.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanserviceStarted
-
Constructor Summary
Constructors Constructor Description TimeoutLockService()
-
Method Summary
Modifier and Type Method Description final BooleangetServiceStarted()Indicates if the service is started or not final TimeoutLockServicestartService()final TimeoutLockServicestopService()UnitonStateChange(ApplicationState state)When receiving 'onFront' or 'cct visible' states, just add them into visibleStack with the function of addStatus, the function will validate the states. abstract UnitonForeground()Represents the state handler when the app is brought up to the foreground abstract UnitonBackground()Represents the state handler when the app is brought up to the background UnitonetimeTimeoutSetting(Integer timeout)Customizes the timeout settings in timeout seconds, this setting will be used only once when the app is put into the background. final UnitupdateLockState(Boolean locked)Updates the 'lock' state of the app. final BooleanisServiceStarted()The status of the timeout lock service final static Booleanpause()Pauses the timeout service, return 'true' if it was started before, 'false' otherwise. final static Unitresume()Resumes the timeout service. final static UnitupdateApplicationLockState(Boolean locked)Updates the application lock state based on the client code needs. final static UnitupdateOnetimeTimeoutSetting(Integer timeoutLockTime)Customizes the timeout settings in timeoutLockTime seconds, this setting will be used only once when the app is put into the background. -
-
Method Detail
-
getServiceStarted
final Boolean getServiceStarted()
Indicates if the service is started or not
-
startService
final TimeoutLockService startService()
-
stopService
final TimeoutLockService stopService()
-
onStateChange
Unit onStateChange(ApplicationState state)
When receiving 'onFront' or 'cct visible' states, just add them into visibleStack with the function of addStatus, the function will validate the states.
-
onForeground
abstract Unit onForeground()
Represents the state handler when the app is brought up to the foreground
-
onBackground
abstract Unit onBackground()
Represents the state handler when the app is brought up to the background
-
onetimeTimeoutSetting
Unit onetimeTimeoutSetting(Integer timeout)
Customizes the timeout settings in timeout seconds, this setting will be used only once when the app is put into the background. If timeout is a minus value, disable the timeout service once.
The child class should be responsible for implementing the above logic, the default one does nothing.
-
updateLockState
final Unit updateLockState(Boolean locked)
Updates the 'lock' state of the app.
-
isServiceStarted
final Boolean isServiceStarted()
The status of the timeout lock service
-
pause
final static Boolean pause()
Pauses the timeout service, return 'true' if it was started before, 'false' otherwise.
-
resume
final static Unit resume()
Resumes the timeout service.
-
updateApplicationLockState
final static Unit updateApplicationLockState(Boolean locked)
Updates the application lock state based on the client code needs. For example, when starting the onboarding or restore flows from the launcher activity, it can call this to 'lock' the app, then go through the restore process.
-
updateOnetimeTimeoutSetting
final static Unit updateOnetimeTimeoutSetting(Integer timeoutLockTime)
Customizes the timeout settings in timeoutLockTime seconds, this setting will be used only once when the app is put into the background. If timeoutLockTime is a minus value, disable the timeout service once.
If no TimeoutLockService which implemented onetimeTimeoutSetting was initialized by SDKInitializer, this call does nothing.
-
-
-
-