0

In android can we get if the user unlocked his phone with either of below method:

  1. PIN
  2. Password
  3. FingerPrint
  4. FaceID
  • Did you find: https://developer.android.com/training/sign-in/biometric-auth#determine-how-user-authenticated – Morrison Chang Mar 04 '22 at 13:29
  • Maybe you misunderstood the question. I want to know if the user has unlocked the device with either of those methods to perform the next action based on that data. – Kevin Patel Mar 07 '22 at 04:41
  • So a duplicate of: [Detect device is secured with pin lock or fingerprint lock of face lock?](https://stackoverflow.com/q/65474598/295004) and it seems it is not possible to get how the user unlocked. – Morrison Chang Mar 07 '22 at 05:58

1 Answers1

0

You can use onPasswordSucceeded callback function from DeviceAdminReceiver services in native and hbrid both. This function triggers when user correct PIN code.

public class MyDeviceAdminReceiver extends DeviceAdminReceiver {
    
    @Override
    public void onPasswordSucceeded(@NonNull Context context, @NonNull Intent intent, @NonNull UserHandle user) {
        super.onPasswordSucceeded(context, intent, user); // Your Code here    
    }    
}
Mostafa Zeinali
  • 2,456
  • 2
  • 15
  • 23