From 8abaea02445d211cc5a0e937920aebba5da73d15 Mon Sep 17 00:00:00 2001 From: Alexandru2909 Date: Tue, 19 Jul 2022 13:45:40 +0300 Subject: [PATCH] For #26089 - Record metrics for save credit card prompt shown --- app/metrics.yaml | 16 ++++++++++++++++ .../fenix/components/metrics/MetricController.kt | 2 ++ .../components/metrics/MetricControllerTest.kt | 1 + 3 files changed, 19 insertions(+) diff --git a/app/metrics.yaml b/app/metrics.yaml index d689c329400a..e59f5f7647db 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -7484,6 +7484,22 @@ credit_cards: metadata: tags: - Autofill + save_prompt_shown: + type: event + description: | + The autofill save prompt is shown. + bugs: + - https://github.com/mozilla-mobile/fenix/issues/26089 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/26095 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: 118 + metadata: + tags: + - Autofill addresses: saved: diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt index dea7d5bdbc5c..f6b5ef0c7499 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt @@ -172,6 +172,8 @@ internal class ReleaseMetricController( CreditCards.savePromptCreate.record(NoExtras()) Component.FEATURE_PROMPTS to CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_UPDATED -> CreditCards.savePromptUpdate.record(NoExtras()) + Component.FEATURE_PROMPTS to CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_SAVE_PROMPT_SHOWN -> + CreditCards.savePromptShown.record(NoExtras()) Component.FEATURE_PROMPTS to AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_FORM_DETECTED -> Addresses.formDetected.record(NoExtras()) diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt index 48b01b72b36b..e3430c617cdb 100644 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt @@ -584,6 +584,7 @@ class MetricControllerTest { CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_PROMPT_DISMISSED to CreditCards.autofillPromptDismissed, CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_CREATED to CreditCards.savePromptCreate, CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_UPDATED to CreditCards.savePromptUpdate, + CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_SAVE_PROMPT_SHOWN to CreditCards.savePromptShown, ) itemsToEvents.forEach { (item, event) ->