0

[tvOS] Disable LAContextCanEvaluatePolicy Method

The LAPolicy used by LAContextCanEvaluatePolicy is not
available on tvOS. This change disables the method using
the tvOS build flag.

Bug: 391914246
Change-Id: I2c1f8f53ddeeaf823bf9f1b4f0fb362925c1e082
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6346508
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1433309}
This commit is contained in:
Gyuyoung Kim
2025-03-16 17:56:50 -07:00
committed by Chromium LUCI CQ
parent 077c43f62d
commit 5f27e5afa1
4 changed files with 8 additions and 0 deletions

@@ -70,8 +70,10 @@ class CRYPTO_EXPORT AppleKeychainV2 {
CFErrorRef* error); CFErrorRef* error);
#endif // !BUILDFLAG(IS_IOS) #endif // !BUILDFLAG(IS_IOS)
#if !BUILDFLAG(IS_IOS_TVOS)
// LAContextCanEvaluatePolicy wraps LAContext's canEvaluatePolicy method. // LAContextCanEvaluatePolicy wraps LAContext's canEvaluatePolicy method.
virtual BOOL LAContextCanEvaluatePolicy(LAPolicy policy, NSError** error); virtual BOOL LAContextCanEvaluatePolicy(LAPolicy policy, NSError** error);
#endif // !BUILDFLAG(IS_IOS_TVOS)
protected: protected:
AppleKeychainV2(); AppleKeychainV2();

@@ -105,10 +105,12 @@ AppleKeychainV2::TaskCopyValueForEntitlement(SecTaskRef task,
} }
#endif // !BUILDFLAG(IS_IOS) #endif // !BUILDFLAG(IS_IOS)
#if !BUILDFLAG(IS_IOS_TVOS)
BOOL AppleKeychainV2::LAContextCanEvaluatePolicy(LAPolicy policy, BOOL AppleKeychainV2::LAContextCanEvaluatePolicy(LAPolicy policy,
NSError** error) { NSError** error) {
LAContext* context = [[LAContext alloc] init]; LAContext* context = [[LAContext alloc] init];
return [context canEvaluatePolicy:policy error:error]; return [context canEvaluatePolicy:policy error:error];
} }
#endif // !BUILDFLAG(IS_IOS_TVOS)
} // namespace crypto } // namespace crypto

@@ -58,8 +58,10 @@ class CRYPTO_EXPORT FakeAppleKeychainV2 : public AppleKeychainV2 {
CFStringRef entitlement, CFStringRef entitlement,
CFErrorRef* error) override; CFErrorRef* error) override;
#endif // !BUILDFLAG(IS_IOS) #endif // !BUILDFLAG(IS_IOS)
#if !BUILDFLAG(IS_IOS_TVOS)
BOOL LAContextCanEvaluatePolicy(LAPolicy policy, BOOL LAContextCanEvaluatePolicy(LAPolicy policy,
NSError* __autoreleasing* error) override; NSError* __autoreleasing* error) override;
#endif // !BUILDFLAG(IS_IOS_TVOS)
private: private:
bool is_secure_enclave_available_ = true; bool is_secure_enclave_available_ = true;

@@ -316,6 +316,7 @@ FakeAppleKeychainV2::TaskCopyValueForEntitlement(SecTaskRef task,
} }
#endif // !BUILDFLAG(IS_IOS) #endif // !BUILDFLAG(IS_IOS)
#if !BUILDFLAG(IS_IOS_TVOS)
BOOL FakeAppleKeychainV2::LAContextCanEvaluatePolicy( BOOL FakeAppleKeychainV2::LAContextCanEvaluatePolicy(
LAPolicy policy, LAPolicy policy,
NSError* __autoreleasing* error) { NSError* __autoreleasing* error) {
@@ -333,5 +334,6 @@ BOOL FakeAppleKeychainV2::LAContextCanEvaluatePolicy(
return false; return false;
} }
} }
#endif // !BUILDFLAG(IS_IOS_TVOS)
} // namespace crypto } // namespace crypto