-->

Have the lock screen's fingerprint sensor list

2019-03-06 09:50发布

问题:

I have an Android application that has one feature which includes showing some content on a view when you unlock your screen after having locked it earlier, and like such it shows up 'in front' of the built-in lock screen (it only overrides it if you don't have any screen security and only swipe away from it). At the moment you need to swipe on your screen to get rid of the view of my app from the screen and to go to the lock screen to enter your security code or whatever security you might have on there.

What I want to implement into my app is a listener for fingerprints. I've read up on just using fingerprints in general and it seems Samsung has an SDK that I can use right off the bat (I'm going to start with just Samsung to see if it works). So this would then replace the swipe which is the only way you can get rid of my app-view at the moment.

There's a dilemma however - I don't want the user to need to scan their finger twice to unlock their phone, I want one time to be enough - but my app isn't showing every time on the phone which I see as too intrusive for the user.

Basically what I'm wondering if there's any way to have the phones original fingerprint security listening for fingerprints whilst my app is on top of it? I don't want it just overlayed as a widget or whatever, but as a separate view - that has the phone's fingerprint listener in the background kind of, and then when you unlock your phone's lock screen by scanning your fingerprint in my app, it would then take you away from both the app and the lock screen.

Is there a way to have the lock screen listen for fingerprints in the background?

回答1:

You could create a BroadcastReceiver on this action ACTION_USER_PRESENT

Broadcast Action: Sent when the user is present after device wakes up (e.g when the keyguard is gone).

This Intent is sent when keyguard (lockscreen) is gone. It's not specific to Fingerprint lockscreen.