Whats the difference between
@RequiresApi(api = Build.VERSION_CODES.M)
class FingerprintHandlerM() : FingerprintManager.AuthenticationCallback()
class requires api level 23...
Similar to what Mike said, as you can see in the documentation:
Denotes that the annotated element should only be called on the given API level or higher.
This is similar in purpose to the older @TargetApi annotation, but more clearly expresses that this is a requirement on the caller, rather than being used to "suppress" warnings within the method that exceed the minSdkVersion.
As you can see here, this is actually enforcing the caller to verify the API that's been used when calling into this method, instead of just removing the warning from your IDE/LINT.
You can compare this to the @NonNull or @Null annotations, they enforce that the caller can/can't send null values into the function.