Which Samsung devices do not support android's native fingerprint API?

前端 未结 3 2168
借酒劲吻你
借酒劲吻你 2021-02-19 23:51

I\'m assuming that no phones with OS before marshmallow support the fingerprint API.

My questions are:

(a) Do all/any Samsung phones released with marshmallow

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 00:29

    I can definitely tell you from my own experience that several Samsung phones continue to use Spass library even on Android M and over. For example right now I'm testing on Mobile OS: Android 6.0.1 (Galaxy Note 4 Edge). I've wrote some code that prints output to the logs in this way:

       /*
        * This function evaluates which fingerprint helper should be instantiated (if any)
        */
        public static FingerprintHelper initializeFingerprintHelper(Context context){
            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                FingerprintManager manager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
    
                if (manager != null) {
                    logger.info("Android native fingerprint manager exists");
                    if (manager.isHardwareDetected()) {
                        logger.info("Android native fingerprint manager detected hardware");
                        if (manager.hasEnrolledFingerprints()) {
                            logger.info("Android native fingerprint manager has enrolled fingerprints");
                        }else{
                            logger.info("Android native fingerprint manager has no enrolled fingerprints");
                        }
                        return new AndroidFingerprintHelper(context);
                    }
    
                }
            }
            try{
                logger.info("Android native fingerprint manager is null, trying Samsung SPASS rollback");
    
                Spass spass = new Spass();
                spass.initialize(context);
                if(spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT)){
                    return new SamsungFingerprintHelper(context);
                }
            } catch (SsdkUnsupportedException e) {
                logger.error("Spass library is missing on the device");
            }
            return null;
        }
    

    And from the logs in the console I see that although Android Version on the devices is M(6.0.1) - the method

    manager.isHardwareDetected()
    

    returns false and the method goes to Spass lib initialization and it suceeds. So the device definitely using Spass library on android M.

提交回复
热议问题