public class Config extends Object
TrustDefender.init(Config)
method. There are 2 compulsory options
Please note that since the TrustDefender.init(Config)
is effective only the
first time it's called during the lifecycle of the application, changing the values of these
options or passing a new Config instance to the init() method does NOT have any effect.
Each setter returns 'this', to allow easy chaining of multiple setter calls, for example
Config config = new Config().setTimeout(10).setContext(context);
Modifier and Type | Field and Description |
---|---|
static long |
THM_OPTION_ALL
Default option bitmask.
|
Constructor and Description |
---|
Config() |
Modifier and Type | Method and Description |
---|---|
Config |
setApiKey(String apiKey)
Set an API key for the profiling request.
|
Config |
setContext(Context context)
This is mandatory.
|
Config |
setDisableAppHashing(boolean disableAppScan)
Disable app hashing, which can potentially be slow.
|
Config |
setDisableInitPackageScan(boolean disableInitPackageScan)
Allows control over package scan during the init call.
|
Config |
setDisableLocSerOnBatteryLow(boolean m_disableLocSerOnBatteryLow)
By setting this flag to true, the location services will be paused when the battery
is low and will be resumed when the device is charging or the battery level
is OK.
|
Config |
setDisableProfilePackageScan(boolean disablePackageScan)
Allows control over package scan during profiling.
|
Config |
setDisableWebView(boolean disableWebView)
Convenience function to disable the WebView in the options bitmask.
|
Config |
setFPServer(String fp_server)
Set the fingerprint server to use.
|
Config |
setHighPowerUpdateTime(long highPowerUpdateTime)
Sets the time, in seconds, between the high power location updates.
|
Config |
setInitPackageScanTimeLimit(int initPackageScanTimeLimit)
During init() a package scan will occur, the init package scan limit (and the init package scan
time limit) controls the behaviour of this scan.
|
Config |
setLocationAccuracy(int accuracy)
Set the configured accuracy to be requested from location services.
|
Config |
setLowPowerUpdateTime(long lowPowerUpdateTime)
Sets the time, in seconds, between the low power location updates.
|
Config |
setOptions(long options)
Sets the profiling options to control which attributes are gathered
|
Config |
setOrgId(String m_orgId)
This is mandatory.
|
Config |
setPackageScanTimeLimit(int packageScanTimeLimit)
Sets the maximum time to spend to process packages during init().
|
Config |
setRegisterForLocationServices(boolean registerForLocationServices)
Register for location services.
|
Config |
setScreenOffTimeout(int screenOffTimeout)
Sets the screen off timeout (in seconds).
|
Config |
setTimeout(int timeout)
Sets the timeout for individual network requests.
|
public static final long THM_OPTION_ALL
public Config setDisableInitPackageScan(boolean disableInitPackageScan)
disableInitPackageScan
- set to false to enable the package scan during init()public Config setDisableProfilePackageScan(boolean disablePackageScan)
disablePackageScan
- set to false to enable the package scan during doProfile()public Config setDisableWebView(boolean disableWebView)
disableWebView
- set to true to disable the WebViewpublic Config setDisableAppHashing(boolean disableAppScan)
TrustDefender.init(Config)
and subsequent profile requests.disableAppScan
- set to true to disable app hashingpublic Config setTimeout(int timeout)
timeout
- in secondspublic Config setApiKey(String apiKey)
apiKey
- to use in profiling requestspublic Config setRegisterForLocationServices(boolean registerForLocationServices)
registerForLocationServices
- If true the SDK registers for location servicespublic Config setLowPowerUpdateTime(long lowPowerUpdateTime)
lowPowerUpdateTime
- time in secondspublic Config setHighPowerUpdateTime(long highPowerUpdateTime)
highPowerUpdateTime
- time in secondspublic Config setLocationAccuracy(int accuracy)
Criteria.ACCURACY_LOW
accuracy
- Criteria
public Config setOptions(long options)
options
- bitmask of profiling optionspublic Config setContext(Context context)
context
- Application Contextpublic Config setPackageScanTimeLimit(int packageScanTimeLimit)
packageScanTimeLimit
- in millisecondpublic Config setInitPackageScanTimeLimit(int initPackageScanTimeLimit)
setPackageScanTimeLimit(int)
initPackageScanTimeLimit
- - maximum time in milliseconds spent in scan during init()public Config setFPServer(String fp_server)
fp_server
- domain to connect to during profilingpublic Config setDisableLocSerOnBatteryLow(boolean m_disableLocSerOnBatteryLow)
m_disableLocSerOnBatteryLow
- The default value is falsepublic Config setScreenOffTimeout(int screenOffTimeout)
screenOffTimeout
seconds. Any profiling
done after that will return instantly with the result of THMStatusCode.THM_Blocked
.
Profiling will be enabled when the screen turns back onscreenOffTimeout
- Number of the seconds before disabling profiling after screen goes
off. The Default value is 180 seconds (3 minutes)