Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Autofill background access check with protected data check #2026

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replacing secureVault background check pixel with new data protected …
…check pixel
  • Loading branch information
amddg44 committed Sep 20, 2023
commit 74929daf805a965457ac9ccc019e0ca84c2f7d85
1 change: 1 addition & 0 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public struct PixelParameters {
public static let bookmarkCount = "bco"

public static let isBackgrounded = "is_backgrounded"
public static let isDataProtected = "is_data_protected"

public static let isInternalUser = "is_internal_user"

Expand Down
7 changes: 3 additions & 4 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ extension Pixel {
case secureVaultInitFailedError
case secureVaultFailedToOpenDatabaseError

// The pixels are for debugging a specific problem and should be removed when resolved
// https://app.asana.com/0/0/1202498365125439/f
case secureVaultIsEnabledCheckedWhenEnabledAndBackgrounded
// Replacing secureVaultIsEnabledCheckedWhenEnabledAndBackgrounded with data protection check
case secureVaultIsEnabledCheckedWhenEnabledAndDataProtected

// MARK: Ad Click Attribution pixels

Expand Down Expand Up @@ -691,7 +690,7 @@ extension Pixel.Event {
case .secureVaultInitFailedError: return "m_secure-vault_error_init-failed"
case .secureVaultFailedToOpenDatabaseError: return "m_secure-vault_error_failed-to-open-database"

case .secureVaultIsEnabledCheckedWhenEnabledAndBackgrounded: return "m_secure-vault_is-enabled-checked_when-enabled-and-backgrounded_2"
case .secureVaultIsEnabledCheckedWhenEnabledAndDataProtected: return "m_secure-vault_is-enabled-checked_when-enabled-and-data-protected"

// MARK: Ad Click Attribution pixels

Expand Down
8 changes: 4 additions & 4 deletions DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2284,10 +2284,10 @@ extension TabViewController: SecureVaultManagerDelegate {
let isEnabled = AutofillSettingStatus.isAutofillEnabledInSettings &&
featureFlagger.isFeatureOn(.autofillCredentialInjecting) &&
!isLinkPreview
let isBackgrounded = UIApplication.shared.applicationState == .background
if isEnabled && isBackgrounded {
Pixel.fire(pixel: .secureVaultIsEnabledCheckedWhenEnabledAndBackgrounded,
withAdditionalParameters: [PixelParameters.isBackgrounded: "true"])
let isDataProtected = !UIApplication.shared.isProtectedDataAvailable
if isEnabled && isDataProtected {
Pixel.fire(pixel: .secureVaultIsEnabledCheckedWhenEnabledAndDataProtected,
withAdditionalParameters: [PixelParameters.isDataProtected: "true"])
}
return isEnabled
}
Expand Down