Package com.appliedrec.verid.ui2
Class VerIDSession
- java.lang.Object
-
- com.appliedrec.verid.ui2.VerIDSession
-
- All Implemented Interfaces:
android.app.Application.ActivityLifecycleCallbacks
,androidx.test.espresso.IdlingResource
,IVerIDSession<VerIDSessionDelegate>
public class VerIDSession extends java.lang.Object implements IVerIDSession<VerIDSessionDelegate>, android.app.Application.ActivityLifecycleCallbacks, androidx.test.espresso.IdlingResource
Ver-ID session class- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description VerIDSession(VerID verID, VerIDSessionSettings settings)
Session constructorVerIDSession(VerID verID, VerIDSessionSettings settings, IStringTranslator stringTranslator)
Session constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<VerIDSessionDelegate>
getDelegate()
Get session delegatejava.lang.String
getName()
Returns the name of the resources (used for logging and idempotency of registration).long
getSessionIdentifier()
Session identifier – can be used to distinguish between different session instancesVerIDSessionSettings
getSettings()
VerID
getVerID()
protected java.util.Optional<ISessionVideoRecorder>
getVideoRecorder()
boolean
isIdleNow()
Returnstrue
if resource is currently idle.void
onActivityCreated(android.app.Activity activity, android.os.Bundle bundle)
Called when the Activity callssuper.onCreate()
.void
onActivityDestroyed(android.app.Activity activity)
Called when the Activity callssuper.onDestroy()
.void
onActivityPaused(android.app.Activity activity)
Called when the Activity callssuper.onPause()
.void
onActivityResumed(android.app.Activity activity)
Called when the Activity callssuper.onResume()
.void
onActivitySaveInstanceState(android.app.Activity activity, android.os.Bundle outState)
Called when the Activity callssuper.onSaveInstanceState()
.void
onActivityStarted(android.app.Activity activity)
Called when the Activity callssuper.onStart()
.void
onActivityStopped(android.app.Activity activity)
Called when the Activity callssuper.onStop()
.void
registerIdleTransitionCallback(androidx.test.espresso.IdlingResource.ResourceCallback callback)
Registers the givenIdlingResource.ResourceCallback
with the resource.void
setDelegate(VerIDSessionDelegate delegate)
Set session delegatevoid
start()
Start the session-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface android.app.Application.ActivityLifecycleCallbacks
onActivityConfigurationChanged, onActivityPostCreated, onActivityPostDestroyed, onActivityPostPaused, onActivityPostResumed, onActivityPostSaveInstanceState, onActivityPostStarted, onActivityPostStopped, onActivityPreCreated, onActivityPreDestroyed, onActivityPrePaused, onActivityPreResumed, onActivityPreSaveInstanceState, onActivityPreStarted, onActivityPreStopped
-
-
-
-
Constructor Detail
-
VerIDSession
public VerIDSession(@NonNull VerID verID, @NonNull VerIDSessionSettings settings)
Session constructor- Parameters:
verID
- Instance of VerID to use for face detection, recognition and user managementsettings
- Session settings- Since:
- 2.0.0
-
VerIDSession
public VerIDSession(@NonNull VerID verID, @NonNull VerIDSessionSettings settings, @NonNull IStringTranslator stringTranslator)
Session constructor- Parameters:
verID
- Instance of VerID to use for face detection, recognition and user managementsettings
- Session settingsstringTranslator
- Translator for strings used in the session- Since:
- 2.0.0
-
-
Method Detail
-
start
public void start()
Start the session- Specified by:
start
in interfaceIVerIDSession<VerIDSessionDelegate>
- Since:
- 2.0.0
-
getSessionIdentifier
public long getSessionIdentifier()
Session identifier – can be used to distinguish between different session instances- Specified by:
getSessionIdentifier
in interfaceIVerIDSession<VerIDSessionDelegate>
- Returns:
- Identifier for the session
- Since:
- 2.0.0
-
getVerID
@NonNull public VerID getVerID()
- Specified by:
getVerID
in interfaceIVerIDSession<VerIDSessionDelegate>
- Returns:
- Instance of VerID being used by the session for face detection, recognition and user management
- Since:
- 2.0.0
-
getSettings
@NonNull public VerIDSessionSettings getSettings()
- Specified by:
getSettings
in interfaceIVerIDSession<VerIDSessionDelegate>
- Returns:
- Session settings
- Since:
- 2.0.0
-
getDelegate
@NonNull public java.util.Optional<VerIDSessionDelegate> getDelegate()
Get session delegate- Specified by:
getDelegate
in interfaceIVerIDSession<VerIDSessionDelegate>
- Returns:
- Optional holding the session delegate or empty optional if delegate not set
- Since:
- 2.0.0
-
setDelegate
public void setDelegate(@Nullable VerIDSessionDelegate delegate)
Set session delegate- Specified by:
setDelegate
in interfaceIVerIDSession<VerIDSessionDelegate>
- Parameters:
delegate
- Session delegate- Since:
- 2.0.0
-
getVideoRecorder
protected java.util.Optional<ISessionVideoRecorder> getVideoRecorder()
-
onActivityCreated
@RestrictTo(LIBRARY_GROUP) public void onActivityCreated(@NonNull android.app.Activity activity, @Nullable android.os.Bundle bundle)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onCreate()
.- Specified by:
onActivityCreated
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivityDestroyed
@RestrictTo(LIBRARY_GROUP) public void onActivityDestroyed(@NonNull android.app.Activity activity)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onDestroy()
.- Specified by:
onActivityDestroyed
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivityStarted
@RestrictTo(LIBRARY_GROUP) public void onActivityStarted(@NonNull android.app.Activity activity)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onStart()
.- Specified by:
onActivityStarted
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivityResumed
@RestrictTo(LIBRARY_GROUP) public void onActivityResumed(@NonNull android.app.Activity activity)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onResume()
.- Specified by:
onActivityResumed
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivityPaused
@RestrictTo(LIBRARY_GROUP) public void onActivityPaused(@NonNull android.app.Activity activity)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onPause()
.- Specified by:
onActivityPaused
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivityStopped
@RestrictTo(LIBRARY_GROUP) public void onActivityStopped(@NonNull android.app.Activity activity)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onStop()
.- Specified by:
onActivityStopped
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
onActivitySaveInstanceState
@RestrictTo(LIBRARY_GROUP) public void onActivitySaveInstanceState(@NonNull android.app.Activity activity, @NonNull android.os.Bundle outState)
Description copied from interface:android.app.Application.ActivityLifecycleCallbacks
Called when the Activity callssuper.onSaveInstanceState()
.- Specified by:
onActivitySaveInstanceState
in interfaceandroid.app.Application.ActivityLifecycleCallbacks
-
getName
public java.lang.String getName()
Description copied from interface:androidx.test.espresso.IdlingResource
Returns the name of the resources (used for logging and idempotency of registration).- Specified by:
getName
in interfaceandroidx.test.espresso.IdlingResource
-
isIdleNow
public boolean isIdleNow()
Description copied from interface:androidx.test.espresso.IdlingResource
Returnstrue
if resource is currently idle. Espresso will always call this method from the main thread, therefore it should be non-blocking and return immediately.- Specified by:
isIdleNow
in interfaceandroidx.test.espresso.IdlingResource
-
registerIdleTransitionCallback
public void registerIdleTransitionCallback(androidx.test.espresso.IdlingResource.ResourceCallback callback)
Description copied from interface:androidx.test.espresso.IdlingResource
Registers the givenIdlingResource.ResourceCallback
with the resource. Espresso will call this method:- with its implementation of
IdlingResource.ResourceCallback
so it can be notified asynchronously that your resource is idle - from the main thread, but you are free to execute the callback's onTransitionToIdle from any thread
- once (when it is initially given a reference to your IdlingResource)
You only need to call this upon transition from busy to idle - if the resource is already idle when the method is called invoking the call back is optional and has no significant impact.
- Specified by:
registerIdleTransitionCallback
in interfaceandroidx.test.espresso.IdlingResource
- with its implementation of
-
-