Since: API level 34
public class

KnoxAiManager

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.ex.knoxAI.KnoxAiManager

Class Overview

Class of managing Knox AI.

Since
API level 34
KNOX 3.7.1

Summary

Nested Classes
enum KnoxAiManager.ErrorCodes The integer error codes for Knox AI APIs. 
Public Methods
KnoxAiSession createKnoxAiSession()
Creates a session for getting secure Knox AI session handle.
KnoxAiManager.ErrorCodes destroyKnoxAiSession(KnoxAiSession session)
Destroys instance of Knox AI session handle.
static KnoxAiManager getInstance(Context context)
void getKeyProvisioning(KeyProvisioningResultCallback cb)
Provision Device Encryption Key(DEK) from Server for KnoxAI ML Model Protection.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public KnoxAiSession createKnoxAiSession ()

Since: API level 34

Creates a session for getting secure Knox AI session handle.

Returns
  • Returns session handle - KnoxAiSession
Throws
SecurityException
Usage
Called before any other Knox AI APIs for AI operations.
     KnoxAiManager knoxAiManager = KnoxAiManager.getInstance(context);
     KnoxAiSession session = knoxAiManager.createKnoxAiSession();
     if(session == null) {
         Log.i(TAG, "Knox AI Session creation failed");
     }
 
Permission
com.samsung.android.knox.permission.KNOX_NDA_AI
Since
API level 34
KNOX 3.7.1
Multiuser Environment
User Scope

public KnoxAiManager.ErrorCodes destroyKnoxAiSession (KnoxAiSession session)

Since: API level 34

Destroys instance of Knox AI session handle.

Throws
SecurityException
Usage
Called to destroy the current session after all AI operations are completed.
         knoxAiManager.destroyKnoxAiSession(session);
 
Permission
com.samsung.android.knox.permission.KNOX_NDA_AI
Since
API level 34
KNOX 3.7.1
Multiuser Environment
User Scope

public static KnoxAiManager getInstance (Context context)

Since: API level 34

Returns
  • KnoxAiManager instance.
Since
API level 34
KNOX 3.7.1

public void getKeyProvisioning (KeyProvisioningResultCallback cb)

Since: API level 34

Provision Device Encryption Key(DEK) from Server for KnoxAI ML Model Protection.

Throws
SecurityException
Usage
Called before any other Knox AI APIs for AI operations , if Device is not provisioned or on receipt of DEVICE_NOT_PROVISIONED error.
 // A KeyProvisioningResultCallback object should be provided to handle the result.
 KeyProvisioningResultCallback cb = new KeyProvisioningResultCallback() {
     void onFinished(KnoxAiManager.ErrorCodes result) { // check status here, DEVICE_PROVISION_FAILED on error.
     }
 }
 KnoxAiManager knoxAiManager = KnoxAiManager.getInstance(context);
 knoxAiManager.getKeyProvisioning(cb); //Result will be available onFinished() of KeyProvisioningResultCallback.
 
 
Permission
com.samsung.android.knox.permission.KNOX_NDA_AI
Since
API level 34
KNOX 3.7.1
Multiuser Environment
User Scope