Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface androidx.test.espresso.IdlingResource

        androidx.test.espresso.IdlingResource.ResourceCallback
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<VerIDSessionDelegate> getDelegate()
      Get session delegate
      java.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 instances
      VerIDSessionSettings getSettings()  
      VerID getVerID()  
      protected java.util.Optional<ISessionVideoRecorder> getVideoRecorder()  
      boolean isIdleNow()
      Returns true if resource is currently idle.
      void onActivityCreated​(android.app.Activity activity, android.os.Bundle bundle)
      Called when the Activity calls super.onCreate().
      void onActivityDestroyed​(android.app.Activity activity)
      Called when the Activity calls super.onDestroy().
      void onActivityPaused​(android.app.Activity activity)
      Called when the Activity calls super.onPause().
      void onActivityResumed​(android.app.Activity activity)
      Called when the Activity calls super.onResume().
      void onActivitySaveInstanceState​(android.app.Activity activity, android.os.Bundle outState)
      Called when the Activity calls super.onSaveInstanceState().
      void onActivityStarted​(android.app.Activity activity)
      Called when the Activity calls super.onStart().
      void onActivityStopped​(android.app.Activity activity)
      Called when the Activity calls super.onStop().
      void registerIdleTransitionCallback​(androidx.test.espresso.IdlingResource.ResourceCallback callback)
      Registers the given IdlingResource.ResourceCallback with the resource.
      void setDelegate​(VerIDSessionDelegate delegate)
      Set session delegate
      void 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 management
        settings - 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 management
        settings - Session settings
        stringTranslator - Translator for strings used in the session
        Since:
        2.0.0
    • Method Detail

      • getSessionIdentifier

        public long getSessionIdentifier()
        Session identifier – can be used to distinguish between different session instances
        Specified by:
        getSessionIdentifier in interface IVerIDSession<VerIDSessionDelegate>
        Returns:
        Identifier for the session
        Since:
        2.0.0
      • getVerID

        @NonNull
        public VerID getVerID()
        Specified by:
        getVerID in interface IVerIDSession<VerIDSessionDelegate>
        Returns:
        Instance of VerID being used by the session for face detection, recognition and user management
        Since:
        2.0.0
      • 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 calls super.onCreate().
        Specified by:
        onActivityCreated in interface android.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 calls super.onDestroy().
        Specified by:
        onActivityDestroyed in interface android.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 calls super.onStart().
        Specified by:
        onActivityStarted in interface android.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 calls super.onResume().
        Specified by:
        onActivityResumed in interface android.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 calls super.onPause().
        Specified by:
        onActivityPaused in interface android.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 calls super.onStop().
        Specified by:
        onActivityStopped in interface android.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 calls super.onSaveInstanceState().
        Specified by:
        onActivitySaveInstanceState in interface android.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 interface androidx.test.espresso.IdlingResource
      • isIdleNow

        public boolean isIdleNow()
        Description copied from interface: androidx.test.espresso.IdlingResource
        Returns true 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 interface androidx.test.espresso.IdlingResource
      • registerIdleTransitionCallback

        public void registerIdleTransitionCallback​(androidx.test.espresso.IdlingResource.ResourceCallback callback)
        Description copied from interface: androidx.test.espresso.IdlingResource
        Registers the given IdlingResource.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 interface androidx.test.espresso.IdlingResource