• BlackBerry Spark
  • Security library for Android applications
  • 0.6.0.1366-beta
ThreatStatus Class Reference

Singleton class providing details of security threats related to the device, application, network, and user. More...

Description

To receive a local broadcast when the ThreatStatus changes, register to intent ACTION_THREAT_STATE_NOTIFICATION.

Public Member Functions

ThreatLevel getOverallThreatLevel ()
 Get the overall level of risk. More...
 
Threat getThreat (ThreatType ruleType)
 Return the threat information for a specific type of threat. More...
 
Vector< ThreatgetThreat ()
 Return status of all threats evaluated. More...
 

Static Public Member Functions

static synchronized ThreatStatus getInstance ()
 Get a reference to the runtime interface object. More...
 

Static Public Attributes

static final String ACTION_THREAT_STATE_NOTIFICATION = "BBDThreatStatusNotification"
 Intent action to receive a local broadcast concerning ThreatStatus changes. More...
 

Member Function Documentation

◆ getInstance()

static synchronized ThreatStatus getInstance ( )
static

Get a reference to the runtime interface object. The ThreatStatus object is a "singleton class"

Returns
Reference that can be used to call, for example, ThreatStatus.getOverallThreatLevel.

◆ getOverallThreatLevel()

ThreatLevel getOverallThreatLevel ( )

Return the overall level of risk combining all threat types being evaluated. For example, if any detected threat poses a HIGH risk then the overall threat level will also be deemed to be HIGH.

Returns
ThreatLevel

◆ getThreat() [1/2]

Threat getThreat ( ThreatType  ruleType)

Return details for specific threat type including the risk level, evaluation time and status.

Parameters
ruleTypeThreatType to be retrieved.
Returns
Threat object for the requested ThreatType.
null if ThreatType does not have corresponding Threat object. For example SafeMessaging & SafeBrowsing where Threat level is specific to each check

◆ getThreat() [2/2]

Vector<Threat> getThreat ( )

Return the threat information of all types of threats which are evaluated by the runtime.

Returns
A vector Threat for all available types.

Member Data Documentation

◆ ACTION_THREAT_STATE_NOTIFICATION

final String ACTION_THREAT_STATE_NOTIFICATION = "BBDThreatStatusNotification"
static

To receive a local broadcast when the ThreatStatus changes register to intent action LibraryInit.ACTION_THREAT_STATE_NOTIFICATION,

Example (Java)

private LibraryInit mSecurity;
..
..
IntentFilter filter = new IntentFilter();
filter.addAction(ThreatStatus.ACTION_THREAT_STATE_NOTIFICATION);
mSecurity.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
//Receive Threat State Notification
//schedule Application specific actions based on Threat State updates received
}
}, filter);