Package com.unitech.api.security
Class SecurityCtrl
java.lang.Object
com.unitech.api.security.SecurityCtrl
The type Security ctrl.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSecurityCtrl(android.content.Context context) Instantiates a new Security ctrl. -
Method Summary
Modifier and TypeMethodDescriptionandroid.os.BundleGets the current lockscreen type, the return value contains the lockscreen type details
The lockscreen setting can be configured in the Settings App > Security > Screen Lock.android.os.BundleLockscreenSetType(String newType, String newParam, String curType, String curParam) Sets the current lockscreen type, the return value contains the lockscreen type details
The lockscreen setting can be configured in the Settings App > Security > Screen Lock.android.os.BundlesetAdbDebugging(boolean enabled) Set adb debugging .
-
Field Details
-
BUNDLE_ERROR_CODE
- See Also:
-
BUNDLE_ERROR_MSG
- See Also:
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR- See Also:
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS- See Also:
-
-
Constructor Details
-
SecurityCtrl
public SecurityCtrl(android.content.Context context) Instantiates a new Security ctrl.- Parameters:
context- the context
-
-
Method Details
-
setAdbDebugging
public android.os.Bundle setAdbDebugging(boolean enabled) Set adb debugging .- Parameters:
enabled- true or false (boolean)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
LockscreenGetType
public android.os.Bundle LockscreenGetType()Gets the current lockscreen type, the return value contains the lockscreen type details
The lockscreen setting can be configured in the Settings App > Security > Screen Lock.
This API returns the current setting in that location.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
Bundle.getInt("Result"); // Result of the execution
Result:
0: Success // when success, the type can be obtained via the Type extra
1: Fail // If fail, the error message can be obtained via the Message extra
2: Not supported // If the device does not support lock screen setting
Bundle.getString("Message"); // Error message if execution fails
Result:
<Description / Error Message>
This can be an empty string, or null.
Bundle.getString("Type");
Result:
"None"
"Swipe"
"Pattern"
"PIN"
"Password"
-
LockscreenSetType
public android.os.Bundle LockscreenSetType(String newType, String newParam, String curType, String curParam) Sets the current lockscreen type, the return value contains the lockscreen type details
The lockscreen setting can be configured in the Settings App > Security > Screen Lock. This API returns the current setting in that location.
When setting the new lockscreen type, you may need to supply the current lockscreen PIN or Password in order to successfully change the lockscreen type.
If you are changing from NONE/SWIPE to any other type then there is no need to supply curType and curParam, however,
if you are changing from PIN/PASSWORD to any other type, then you must provide curType and curParam.- Parameters:
newType- : A string indicating the new screen lock type. It can be one of the following strings:
"None"
"Swipe"
"PIN"
"Password"newParam- : The parameter of the new screen lock type if it requires one. For example
- For “PIN” type, enters the PIN code string (numeric)
- For “Password” type, enters the password string (alphanumeric)curType- : If the device’s current lockscreen type is PIN or PASSWORD, you must provide this parameter.
A string indicating the current screen lock type. It can be one of the following strings:
"None"
"Swipe"
"PIN"
"Password"curParam- : If the device’s current lockscreen type is PIN or PASSWORD, you must provide this parameter.
- For None and Swipe type, set this string as NULL or EMPTY STRING
- For “PIN” type, enters the current PIN code string (numeric)
- For “Password” type, enters the current password string (alphanumeric)- Returns:
- Return values indicates whether the setting is success or not, and
the error message if it fails.
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
Bundle.getInt("Result"); // Result of the execution
Result:
0: Success
1: Fail
2: Not supported // if the Type param is Pattern, or if the device does not support lock screen setting
Bundle.getString("Message"); // Error message if execution fails
Result:
<Description / Error Message>
This can be an empty string, or null.
-