use of android.os.CancellationSignal in project android_frameworks_base by crdroidandroid.
the class MtpManagerTest method testEventObjectAdded.
public void testEventObjectAdded() throws Exception {
while (true) {
getInstrumentation().show("Please take a photo by using connected MTP device.");
final CancellationSignal signal = new CancellationSignal();
MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
continue;
}
assertTrue(event.getObjectHandle() != 0);
break;
}
}
use of android.os.CancellationSignal in project android_frameworks_base by crdroidandroid.
the class KeyguardUpdateMonitor method startListeningForFingerprint.
private void startListeningForFingerprint() {
if (mFingerprintRunningState == FINGERPRINT_STATE_CANCELLING) {
setFingerprintRunningState(FINGERPRINT_STATE_CANCELLING_RESTARTING);
return;
}
if (DEBUG)
Log.v(TAG, "startListeningForFingerprint()");
int userId = ActivityManager.getCurrentUser();
if (isUnlockWithFingerprintPossible(userId)) {
if (mFingerprintCancelSignal != null) {
mFingerprintCancelSignal.cancel();
}
mFingerprintCancelSignal = new CancellationSignal();
mFpm.authenticate(null, mFingerprintCancelSignal, 0, mAuthenticationCallback, null, userId);
setFingerprintRunningState(FINGERPRINT_STATE_RUNNING);
}
}
Aggregations