Since: API level 19
public class

SdpDatabase

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.sdp.SdpDatabase

Deprecated in API level 33

Class Overview

SdpDatabase provides convenient APIs to access a database and set its columns as sensitive.

Since
API level 19
KNOX 2.6

Summary

Public Constructors
SdpDatabase(String alias)
Deprecated in API level 33
Public Methods
boolean isSensitive(SQLiteDatabase db, String dbAlias, String tblName, String column)
Deprecated in API level 33
boolean setSensitive(SQLiteDatabase db, String dbAlias, String tblName, List<String> columns)
Deprecated in API level 33
boolean updateStateToDB(SQLiteDatabase db, String dbAlias, int state)
Deprecated in API level 33
boolean updateStateToDB(SQLiteDatabase db, int state)
Deprecated in API level 33
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SdpDatabase (String alias)

Since: API level 19

Deprecated in API level 33

Construct a new SdpDatabase object with the given alias.

Usage:

        An application developer can use this constructor to create an instance of the object.


     try {

         SdpDatabase sdpDatabase = new SdpDatabase(mEngineAlias);

         sdpDatabase.updateStateToDB(db, state);

     } catch (SdpException e) {

         e.printStackTrace();

     }

 

Parameters
alias SdpEngine alias. null for default engine.
Throws
SdpException thrown when SDP engine doesn't exist or license activation is required.
Since
API level 19
KNOX 2.6
Multiuser Environment
User Scope

Public Methods

public boolean isSensitive (SQLiteDatabase db, String dbAlias, String tblName, String column)

Since: API level 19

Deprecated in API level 33

API checks whether a column in the database is sensitive or not.

Usage:

        An application developer can use this API to check whether a column in the database is sensitive or not.


     try {

         SdpDatabase sDb = new SdpDatabase(null);

         if (sDb.isSensitive(dbHandle, dbAlias, tblName, columns)) {

             Log.d(TAG, "Sensitive column!");

         }

     } catch (SdpException e) {

         e.printStackTrace();

     }

 

Parameters
db SQLiteDatabase object to configure sensitive column.
dbAlias Database alias.
tblName Table name.
column Column name to test for sensitive attribute.
Returns
  • true if column is sensitive, otherwise false.
Since
API level 19
KNOX 2.6
Multiuser Environment
User Scope

public boolean setSensitive (SQLiteDatabase db, String dbAlias, String tblName, List<String> columns)

Since: API level 19

Deprecated in API level 33

API sets the column(s) in the database as sensitive. SdpEngine must be unlocked before trying to set a column as sensitive.

Usage:

        An application developer can use this API to configure the sensitiveness, to determine which sensitive data to protect. Please ensure that DB Handle MUST have WRITE access to call this API.


     try {

         SdpDatabase sDb = new SdpDatabase(null);

         sDb.setSensitive(dbHandle, dbAlias, tblName, columns);

     } catch (SdpException e) {

         e.printStackTrace();

     }

 

Parameters
db SQLiteDatabase object to configure sensitive column.
dbAlias Database alias.
tblName Table name.
columns String list of columns.
Returns
  • true on success, otherwise false.
Throws
SdpException thrown when SDP engine is locked.
Since
API level 19
KNOX 2.6
Multiuser Environment
User Scope

public boolean updateStateToDB (SQLiteDatabase db, String dbAlias, int state)

Since: API level 19

Deprecated in API level 33

API to propagate the SdpEngine state to the database engine. This is required to initiate maintenance tasks that improve database performance.

Usage:

        An application developer can use this API to send the current state to database handle.


     try {

         SdpDatabase sDb = new SdpDatabase(null);

         sDb.updateStateToDB(dbHandle, dbAlias, SdpEngineConstants.State.LOCKED);

     } catch (SdpException e) {

         e.printStackTrace();

     }

 

Parameters
db SQLiteDatabase object to configure sensitive column.
dbAlias Database alias.
state SdpEngine state.
Returns
  • true on success, otherwise false.
Since
API level 19
KNOX 2.6
Multiuser Environment
User Scope

public boolean updateStateToDB (SQLiteDatabase db, int state)

Since: API level 19

Deprecated in API level 33

API to propagate the SdpEngine state to the database engine. This is required to initiate maintenance tasks that improve database performance.

Usage:

        Method updates the state to the database engine on state change.


     public void onStateChange(int state) {

         super.onStateChange(state);

         mSdpDatabaseHelper.updateStateToDB(state);

     }

 

Parameters
db SQLiteDatabase object to configure sensitive column.
state SdpEngine state.
Returns
  • true on success, otherwise false.
Since
API level 19
KNOX 2.6
Multiuser Environment
User Scope