Fingerprint interface
simple description
- Fingerprint power interface
1. method
EnableFingerpint(String key,boolean enable);
Call method
- SystemProperties.EnableFingerpint(String key,boolean enable);
parameter
parameter name | necessary | type | Description |
---|
key | yes | string | The key value of the corresponding module |
enable | yes | boolean | power on or off |
Call example (to facilitate third-party application calls, use reflection to obtain SystemProperties)
setEnable("finger",true); "finger" is fingerprint KEY
public static void setEnable(final String key, final boolean def) {
try {
if (getinfor == null) {
getinfor = Class.forName("android.os.SystemProperties")
.getMethod("EnableFingerpint", String.class,boolean.class);
}
getinfor.invoke(null, key,def) ;
} catch (Exception e) {
e.printStackTrace();
}
}
2 .Get module status interface
method
ReadFingerpint(String key);
Call method
- SystemProperties.ReadFingerpint(String key);
parameter name | necessary | type | Description |
---|
key | yes | string | The key value of the corresponding module |
Call example (to facilitate third-party application calls, use reflection to obtain SystemProperties)
int statu = test("finger","-1") "finger" is fingerprint KEY
public static String test(final String key,String def) {
try {
if (Getfingerpint == null) {
Getfingerpint = Class.forName("android.os.SystemProperties")
.getMethod("ReadFingerpint", String.class);
}
return ((String) Getfingerpint.invoke(null, key)).toString();
} catch (Exception e) {
e.printStackTrace();
}
return def;
}
Return parameter description
parameter name | type | Description |
---|
statu | int | Return value, 1 means power-on state 0 means power-off state |