Commit e4667667 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Chromium LUCI CQ

[iOS][Getaway] Fall back to Passcode string correctly.

On a device with a biometric sensor which is disabled, LAContext's
biometryType will be set to the type of the sensor, even if it's not
set up. Check the error instead to see when a fallback to Passcode is
required.

Fixed: 1161175
Change-Id: I3db27208e46cd6aa11cf802e90086c1c040dc330
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601356
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Auto-Submit: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarRobbie Gibson <rkgibson@google.com>
Cr-Commit-Position: refs/heads/master@{#840115}
parent b030e3d6
...@@ -15,8 +15,14 @@ ...@@ -15,8 +15,14 @@
NSString* biometricAuthenticationTypeString() { NSString* biometricAuthenticationTypeString() {
LAContext* ctx = [[LAContext alloc] init]; LAContext* ctx = [[LAContext alloc] init];
// Call canEvaluatePolicy:error: once to populate biometrics type // Call canEvaluatePolicy:error: once to populate biometrics type
NSError* error;
[ctx canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics [ctx canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
error:nil]; error:&error];
if (error.code == LAErrorBiometryNotAvailable ||
error.code == LAErrorBiometryNotEnrolled) {
return l10n_util::GetNSString(IDS_IOS_INCOGNITO_REAUTH_PASSCODE);
}
switch (ctx.biometryType) { switch (ctx.biometryType) {
case LABiometryTypeFaceID: case LABiometryTypeFaceID:
return @"Face ID"; return @"Face ID";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment