Search in sources :

Example 26 with CancellationSignal

use of android.os.CancellationSignal in project android_frameworks_base by AOSPA.

the class PrinterDiscoverySession method requestCustomPrinterIcon.

/**
     * Request the custom icon for a printer.
     *
     * @param printerId The printer to icon belongs to.
     * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon()
     */
void requestCustomPrinterIcon(@NonNull PrinterId printerId) {
    if (!mIsDestroyed && mObserver != null) {
        CustomPrinterIconCallback callback = new CustomPrinterIconCallback(printerId, mObserver);
        onRequestCustomPrinterIcon(printerId, new CancellationSignal(), callback);
    }
}
Also used : CancellationSignal(android.os.CancellationSignal)

Example 27 with CancellationSignal

use of android.os.CancellationSignal in project AmazeFileManager by TeamAmaze.

the class FingerprintHandler method authenticate.

@RequiresApi(api = Build.VERSION_CODES.M)
public void authenticate(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {
    CancellationSignal cancellationSignal = new CancellationSignal();
    if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        return;
    }
    manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
}
Also used : CancellationSignal(android.os.CancellationSignal) RequiresApi(android.support.annotation.RequiresApi)

Example 28 with CancellationSignal

use of android.os.CancellationSignal in project android_packages_apps_Settings by omnirom.

the class FingerprintUiHelper method startListening.

public void startListening() {
    if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected() && mFingerprintManager.getEnrolledFingerprints(mUserId).size() > 0) {
        mCancellationSignal = new CancellationSignal();
        mFingerprintManager.setActiveUser(mUserId);
        mFingerprintManager.authenticate(null, mCancellationSignal, 0, /* flags */
        this, null, mUserId);
        setFingerprintIconVisibility(true);
        mIcon.setImageResource(R.drawable.ic_fingerprint);
    }
}
Also used : CancellationSignal(android.os.CancellationSignal)

Example 29 with CancellationSignal

use of android.os.CancellationSignal in project android_packages_apps_Settings by SudaMod.

the class FingerprintEnrollSidecar method startEnrollment.

private void startEnrollment() {
    mHandler.removeCallbacks(mTimeoutRunnable);
    mEnrollmentSteps = -1;
    mEnrollmentCancel = new CancellationSignal();
    if (mUserId != UserHandle.USER_NULL) {
        mFingerprintManager.setActiveUser(mUserId);
    }
    mFingerprintManager.enroll(mToken, mEnrollmentCancel, 0, /* flags */
    mUserId, mEnrollmentCallback);
    mEnrolling = true;
}
Also used : CancellationSignal(android.os.CancellationSignal)

Example 30 with CancellationSignal

use of android.os.CancellationSignal in project android_packages_apps_Settings by SudaMod.

the class FingerprintUiHelper method startListening.

public void startListening() {
    if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected() && mFingerprintManager.getEnrolledFingerprints(mUserId).size() > 0) {
        mCancellationSignal = new CancellationSignal();
        mFingerprintManager.setActiveUser(mUserId);
        mFingerprintManager.authenticate(null, mCancellationSignal, 0, /* flags */
        this, null, mUserId);
        setFingerprintIconVisibility(true);
        mIcon.setImageResource(R.drawable.ic_fingerprint);
    }
}
Also used : CancellationSignal(android.os.CancellationSignal)

Aggregations

CancellationSignal (android.os.CancellationSignal)79 OperationCanceledException (android.os.OperationCanceledException)18 Cursor (android.database.Cursor)13 FileNotFoundException (java.io.FileNotFoundException)11 IOException (java.io.IOException)11 RemoteException (android.os.RemoteException)10 FingerprintManager (android.hardware.fingerprint.FingerprintManager)8 ContentProviderClient (android.content.ContentProviderClient)7 ContentResolver (android.content.ContentResolver)6 Uri (android.net.Uri)6 ParcelFileDescriptor (android.os.ParcelFileDescriptor)6 AssetFileDescriptor (android.content.res.AssetFileDescriptor)5 MtpEvent (android.mtp.MtpEvent)5 InputStream (java.io.InputStream)5 FutureTask (java.util.concurrent.FutureTask)4 Test (org.junit.Test)4 KeyguardManager (android.app.KeyguardManager)2 BiometricPrompt (android.hardware.biometrics.BiometricPrompt)2 Bundle (android.os.Bundle)2 Handler (android.os.Handler)2