Merge "Fix bug where fingerprint for wrong userId was attempted to be removed." into nyc-dev
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 1182ed5..74ec4bb 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -651,8 +651,10 @@
             if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()
                     && mFingerprintManager.hasEnrolledFingerprints(userId)) {
                 mFingerprintManager.setActiveUser(userId);
-                mFingerprintManager.remove(
-                        new Fingerprint(null, userId, 0, 0), userId,
+                // For the purposes of M and N, groupId is the same as userId.
+                final int groupId = userId;
+                Fingerprint finger = new Fingerprint(null, groupId, 0, 0);
+                mFingerprintManager.remove(finger, userId,
                         new RemovalCallback() {
                             @Override
                             public void onRemovalError(Fingerprint fp, int errMsgId,