Search in sources :

Example 21 with MagiskManager

use of com.topjohnwu.magisk.MagiskManager in project MagiskManager by topjohnwu.

the class FingerprintHelper method canUseFingerprint.

public static boolean canUseFingerprint() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
        return false;
    MagiskManager mm = MagiskManager.get();
    KeyguardManager km = mm.getSystemService(KeyguardManager.class);
    FingerprintManager fm = mm.getSystemService(FingerprintManager.class);
    return km.isKeyguardSecure() && fm != null && fm.isHardwareDetected() && fm.hasEnrolledFingerprints();
}
Also used : MagiskManager(com.topjohnwu.magisk.MagiskManager) FingerprintManager(android.hardware.fingerprint.FingerprintManager) KeyguardManager(android.app.KeyguardManager)

Aggregations

MagiskManager (com.topjohnwu.magisk.MagiskManager)21 IOException (java.io.IOException)7 PendingIntent (android.app.PendingIntent)6 Intent (android.content.Intent)6 AlertDialogBuilder (com.topjohnwu.magisk.components.AlertDialogBuilder)6 InputStream (java.io.InputStream)6 NotificationManager (android.app.NotificationManager)5 NotificationCompat (android.support.v4.app.NotificationCompat)5 TaskStackBuilder (android.support.v4.app.TaskStackBuilder)5 SuFile (com.topjohnwu.superuser.io.SuFile)4 Activity (android.app.Activity)3 Shell (com.topjohnwu.superuser.Shell)3 ShellUtils (com.topjohnwu.superuser.ShellUtils)3 BufferedInputStream (java.io.BufferedInputStream)3 BufferedOutputStream (java.io.BufferedOutputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 File (java.io.File)3 FileOutputStream (java.io.FileOutputStream)3 OutputStream (java.io.OutputStream)3 Manifest (android.Manifest)2