看看FingerprintManagerCompat javadoc:
A class that coordinates access to the fingerprint hardware.
On platforms before M,this class behaves as there would be no
fingerprint hardware available.
看一下源代码:
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
// a working implementation
IMPL = new Api23FingerprintManagerCompatImpl();
} else {
// an empty stub
IMPL = new LegacyFingerprintManagerCompatImpl();
}
如果您的设备低于API VERSION 23,则使用LegacyFingerprintManagerCompatImpl,这只是一个STUB.例如:
@Override
public boolean hasEnrolledFingerprints(Context context) {
return false;
}
@Override
public boolean isHardwareDetected(Context context) {
return false;
}
您不能在旧设备中使用此功能.那些API(一些来自android.security.keystore)仅在Android M上可用