Merge "Add logging to track fingerprint reco but not unlocking" into mnc-dr-dev
This commit is contained in:
@@ -775,7 +775,7 @@ public class FingerprintManager {
|
|||||||
if (fingerId != reqFingerId) {
|
if (fingerId != reqFingerId) {
|
||||||
Log.w(TAG, "Finger id didn't match: " + fingerId + " != " + reqFingerId);
|
Log.w(TAG, "Finger id didn't match: " + fingerId + " != " + reqFingerId);
|
||||||
}
|
}
|
||||||
if (fingerId != reqFingerId) {
|
if (groupId != reqGroupId) {
|
||||||
Log.w(TAG, "Group id didn't match: " + groupId + " != " + reqGroupId);
|
Log.w(TAG, "Group id didn't match: " + groupId + " != " + reqGroupId);
|
||||||
}
|
}
|
||||||
mRemovalCallback.onRemovalSucceeded(mRemovalFingerprint);
|
mRemovalCallback.onRemovalSucceeded(mRemovalFingerprint);
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stopPendingOperations(true);
|
stopPendingOperations(true);
|
||||||
mEnrollClient = new ClientMonitor(token, receiver, groupId, restricted);
|
mEnrollClient = new ClientMonitor(token, receiver, groupId, restricted, token.toString());
|
||||||
final int timeout = (int) (ENROLLMENT_TIMEOUT_MS / MS_PER_SEC);
|
final int timeout = (int) (ENROLLMENT_TIMEOUT_MS / MS_PER_SEC);
|
||||||
try {
|
try {
|
||||||
final int result = daemon.enroll(cryptoToken, groupId, timeout);
|
final int result = daemon.enroll(cryptoToken, groupId, timeout);
|
||||||
@@ -417,14 +417,15 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startAuthentication(IBinder token, long opId, int groupId,
|
void startAuthentication(IBinder token, long opId, int groupId,
|
||||||
IFingerprintServiceReceiver receiver, int flags, boolean restricted) {
|
IFingerprintServiceReceiver receiver, int flags, boolean restricted,
|
||||||
|
String opPackageName) {
|
||||||
IFingerprintDaemon daemon = getFingerprintDaemon();
|
IFingerprintDaemon daemon = getFingerprintDaemon();
|
||||||
if (daemon == null) {
|
if (daemon == null) {
|
||||||
Slog.w(TAG, "startAuthentication: no fingeprintd!");
|
Slog.w(TAG, "startAuthentication: no fingeprintd!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stopPendingOperations(true);
|
stopPendingOperations(true);
|
||||||
mAuthClient = new ClientMonitor(token, receiver, groupId, restricted);
|
mAuthClient = new ClientMonitor(token, receiver, groupId, restricted, opPackageName);
|
||||||
if (inLockoutMode()) {
|
if (inLockoutMode()) {
|
||||||
Slog.v(TAG, "In lockout mode; disallowing authentication");
|
Slog.v(TAG, "In lockout mode; disallowing authentication");
|
||||||
if (!mAuthClient.sendError(FingerprintManager.FINGERPRINT_ERROR_LOCKOUT)) {
|
if (!mAuthClient.sendError(FingerprintManager.FINGERPRINT_ERROR_LOCKOUT)) {
|
||||||
@@ -481,7 +482,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopPendingOperations(true);
|
stopPendingOperations(true);
|
||||||
mRemoveClient = new ClientMonitor(token, receiver, userId, restricted);
|
mRemoveClient = new ClientMonitor(token, receiver, userId, restricted, token.toString());
|
||||||
// The fingerprint template ids will be removed when we get confirmation from the HAL
|
// The fingerprint template ids will be removed when we get confirmation from the HAL
|
||||||
try {
|
try {
|
||||||
final int result = daemon.remove(fingerId, userId);
|
final int result = daemon.remove(fingerId, userId);
|
||||||
@@ -574,11 +575,11 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
}
|
}
|
||||||
if (mAppOps.noteOp(AppOpsManager.OP_USE_FINGERPRINT, uid, opPackageName)
|
if (mAppOps.noteOp(AppOpsManager.OP_USE_FINGERPRINT, uid, opPackageName)
|
||||||
!= AppOpsManager.MODE_ALLOWED) {
|
!= AppOpsManager.MODE_ALLOWED) {
|
||||||
Slog.v(TAG, "Rejecting " + opPackageName + " ; permission denied");
|
Slog.w(TAG, "Rejecting " + opPackageName + " ; permission denied");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (foregroundOnly && !isForegroundActivity(uid, pid)) {
|
if (foregroundOnly && !isForegroundActivity(uid, pid)) {
|
||||||
Slog.v(TAG, "Rejecting " + opPackageName + " ; not in foreground");
|
Slog.w(TAG, "Rejecting " + opPackageName + " ; not in foreground");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -606,13 +607,15 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
IFingerprintServiceReceiver receiver;
|
IFingerprintServiceReceiver receiver;
|
||||||
int userId;
|
int userId;
|
||||||
boolean restricted; // True if client does not have MANAGE_FINGERPRINT permission
|
boolean restricted; // True if client does not have MANAGE_FINGERPRINT permission
|
||||||
|
String owner;
|
||||||
|
|
||||||
public ClientMonitor(IBinder token, IFingerprintServiceReceiver receiver, int userId,
|
public ClientMonitor(IBinder token, IFingerprintServiceReceiver receiver, int userId,
|
||||||
boolean restricted) {
|
boolean restricted, String owner) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.receiver = receiver;
|
this.receiver = receiver;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.restricted = restricted;
|
this.restricted = restricted;
|
||||||
|
this.owner = owner; // name of the client that owns this - for debugging
|
||||||
try {
|
try {
|
||||||
token.linkToDeath(this, 0);
|
token.linkToDeath(this, 0);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -695,6 +698,10 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
if (!authenticated) {
|
if (!authenticated) {
|
||||||
receiver.onAuthenticationFailed(mHalDeviceId);
|
receiver.onAuthenticationFailed(mHalDeviceId);
|
||||||
} else {
|
} else {
|
||||||
|
if (DEBUG) {
|
||||||
|
Slog.v(TAG, "onAuthenticated(owner=" + mAuthClient.owner
|
||||||
|
+ ", id=" + fpId + ", gp=" + groupId + ")");
|
||||||
|
}
|
||||||
Fingerprint fp = !restricted ?
|
Fingerprint fp = !restricted ?
|
||||||
new Fingerprint("" /* TODO */, groupId, fpId, mHalDeviceId) : null;
|
new Fingerprint("" /* TODO */, groupId, fpId, mHalDeviceId) : null;
|
||||||
receiver.onAuthenticationSucceeded(mHalDeviceId, fp);
|
receiver.onAuthenticationSucceeded(mHalDeviceId, fp);
|
||||||
@@ -915,6 +922,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
final IFingerprintServiceReceiver receiver, final int flags,
|
final IFingerprintServiceReceiver receiver, final int flags,
|
||||||
final String opPackageName) {
|
final String opPackageName) {
|
||||||
if (!canUseFingerprint(opPackageName, true /* foregroundOnly */)) {
|
if (!canUseFingerprint(opPackageName, true /* foregroundOnly */)) {
|
||||||
|
if (DEBUG) Slog.v(TAG, "authenticate(): reject " + opPackageName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -927,7 +935,8 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
MetricsLogger.histogram(mContext, "fingerprint_token", opId != 0L ? 1 : 0);
|
MetricsLogger.histogram(mContext, "fingerprint_token", opId != 0L ? 1 : 0);
|
||||||
startAuthentication(token, opId, effectiveGroupId, receiver, flags, restricted);
|
startAuthentication(token, opId, effectiveGroupId, receiver, flags, restricted,
|
||||||
|
opPackageName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user