feat: add support for unlocking with Apple Watch (#36935)
This commit is contained in:
parent
c303135b02
commit
1486cbdf64
1 changed files with 4 additions and 3 deletions
|
@ -425,9 +425,10 @@ std::string SystemPreferences::GetSystemColor(gin_helper::ErrorThrower thrower,
|
||||||
|
|
||||||
bool SystemPreferences::CanPromptTouchID() {
|
bool SystemPreferences::CanPromptTouchID() {
|
||||||
base::scoped_nsobject<LAContext> context([[LAContext alloc] init]);
|
base::scoped_nsobject<LAContext> context([[LAContext alloc] init]);
|
||||||
if (![context
|
LAPolicy auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
|
||||||
canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
|
if (@available(macOS 10.15, *))
|
||||||
error:nil])
|
auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch;
|
||||||
|
if (![context canEvaluatePolicy:auth_policy error:nil])
|
||||||
return false;
|
return false;
|
||||||
if (@available(macOS 10.13.2, *))
|
if (@available(macOS 10.13.2, *))
|
||||||
return [context biometryType] == LABiometryTypeTouchID;
|
return [context biometryType] == LABiometryTypeTouchID;
|
||||||
|
|
Loading…
Add table
Reference in a new issue